Skip to main content

Configuring Dependabot security updates

You can use Dependabot 安全更新 or manual pull requests to easily update vulnerable dependencies.

注意: Dependabot 安全和版本更新目前处于公开测试阶段,可能会发生更改。

Note: Your site administrator must set up Dependabot 更新 for 您的 GitHub Enterprise Server 实例 before you can use this feature. For more information, see "Enabling Dependabot for your enterprise."

About configuring Dependabot 安全更新

You can enable Dependabot 安全更新 for any repository that uses Dependabot 警报 and the dependency graph. For more information, see "About Dependabot 安全更新."

You can disable Dependabot 安全更新 for an individual repository or for all repositories owned by your personal account or organization. For more information, see "Managing Dependabot 安全更新 for your repositories" below.

Supported repositories

GitHub automatically enables Dependabot 安全更新 for every repository that meets these prerequisites.

Note: You can manually enable Dependabot 安全更新, even if the repository doesn't meet some of the prerequisites below. For example, you can enable Dependabot 安全更新 on a fork, or for a package manager that isn't directly supported by following the instructions in "Managing Dependabot 安全更新 for your repositories."

Automatic enablement prerequisiteMore information
Repository is not a fork"About forks"
Repository is not archived"Archiving repositories"
Repository contains dependency manifest file from a package ecosystem that GitHub supports"Supported package ecosystems"
Dependabot 安全更新 are not disabled for the repository"Managing Dependabot 安全更新 for your repository"

If security updates are not enabled for your repository and you don't know why, first try enabling them using the instructions given in the procedural sections below. If security updates are still not working, you can contact 您的网站管理员.

Managing Dependabot 安全更新 for your repositories

You can enable or disable Dependabot 安全更新 for an individual repository (see below).

You can also enable or disable Dependabot 安全更新 for all repositories owned by your personal account or organization. For more information, see "Managing security and analysis settings for your personal account" or "Managing security and analysis settings for your organization."

Dependabot 安全更新 require specific repository settings. For more information, see "Supported repositories."

Enabling or disabling Dependabot 安全更新 for an individual repository

  1. 在 您的 GitHub Enterprise Server 实例 上,导航到仓库的主页面。

  2. 在仓库名称下,单击 Settings(设置)仓库设置按钮

  3. 在左侧边栏中,单击 Security & analysis(安全和分析)仓库设置中的"Security & analysis(安全和分析)"选项卡

  4. Under "Code security and analysis", to the right of "Dependabot security updates", click Enable to enable the feature or Disable to disable it. Screenshot of "Code security and analysis" section with button to enable Dependabot 安全更新

Overriding the default behavior with a configuration file

You can override the default behavior of Dependabot 安全更新 by adding a dependabot.yml file to your repository. For more information, see "Configuration options for the dependabot.yml file."

If you only require security updates and want to exclude version updates, you can set open-pull-request-limit to 0 in order to prevent version updates for a given package-ecosystem. For more information, see "open-pull-request-limit."

# Example configuration file that:
#  - Ignores lodash dependency
#  - Disables version-updates

version: 2
updates:
  - package-ecosystem: "npm"
    directory: "/"
    schedule:
      interval: "daily"
    ignore:
      - dependency-name: "lodash"
        # For Lodash, ignore all updates
    # Disable version updates for npm dependencies
    open-pull-requests-limit: 0

For more information about the configuration options available for security updates, see the table in "Configuration options for the dependabot.yml file."

Further reading