簡體   English   中英

如何禁用或忽略 Dependabot 拉取請求?

[英]How to disable or ignore Dependabot pull requests?

我們想使用 Dependabot 來了解更新的依賴項,但我們不希望 Dependabot 自己創建拉取請求,也不希望自動構建(我們使用 GitHub 代碼,Azure DevOps 構建)。

文檔 ( https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions ) 中沒有明確的提示來執行此操作。 我們已經嘗試排除 dependabot 分支,但這在任何形式下都不起作用。

# Azure DevOps Excludes
pr:
  autoCancel: "true"
  branches:
    exclude:
    - dependabot/*
    - dependabot/**/*

我們還在 Stack Overflow 上找到了將限制設置為 0 的提示,但仍然創建了 PR

version: 2
updates:
  - directory: "/"
    open-pull-requests-limit: 0

是否有可能將 Dependabot 用作信息源?

默認情況下, Dependabot將自動重置拉取請求以解決任何沖突。 如果您更喜歡手動處理合並沖突,您可以使用rebase-strategy選項禁用此功能。

對於變基策略,使用disabled禁用自動變基。

設置此選項還將影響對此包管理器清單文件的安全更新的拉取請求,除非您使用target-branch檢查非默認分支上的版本更新。

對於rebase-strategy示例,

version: 2

updates:

  - directory: "/"

    schedule:

      interval: "daily"

    # Disable Dependabot pull requests

    rebase-strategy: "disabled"
  1. Go 到 Security -> Dependabot -> Configure -> Manage Repository Vulnerability Settings。 (這應該會帶您到 URL,例如https://github.com/yourusername/yourreponame/settings/security_analysis 。)

  2. 啟用“Dependabot 警報”設置,但確保禁用“Dependabot 版本更新”設置。

    如果您之前啟用了“Dependabot 版本更新”,您的存儲庫中將有一個.github/dependabot.yml文件,其目的是配置 Dependabot 的自動更新。 要禁用它們,請刪除dependabot.yml

在圖片中:

顯示上述步驟 1 的屏幕截圖

顯示上述步驟 2 的屏幕截圖

您現在仍然可以在 GitHub 上查看有關您的依賴項的安全警報,但 Dependabot 不會為它們打開 PR。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM