Skip to main content

Configuring Dependabot security updates

You can use Dependabot security updates or manual pull requests to easily update vulnerable dependencies.

Note: Dependabot security and version updates are currently in public beta and subject to change.

注意:站点管理员必须先为 your GitHub Enterprise Server instance设置 Dependabot updates,然后你才能使用此功能。 有关详细信息,请参阅“对企业启用 Dependabot”。

About configuring Dependabot security updates

You can enable Dependabot security updates at the repository level or for all repositories owned by your personal account or organization. You can enable Dependabot security updates for any repository that uses Dependabot alerts and the dependency graph. For more information, see "About Dependabot security updates."

You can disable Dependabot security updates for an individual repository or for all repositories owned by your personal account or organization.

Supported repositories

GitHub automatically enables Dependabot security updates for newly created repositories if your personal account or organization has enabled Automatically enable for new repositories for Dependabot security updates. For more information, see "Managing Dependabot security updates for your repositories."

If you create a fork of a repository that has security updates enabled, GitHub will automatically disable Dependabot security updates for the fork. You can then decide whether to enable Dependabot security updates on the specific fork.

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 security updates for your repositories

You can enable or disable Dependabot security updates for all qualifying 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."

You can also enable or disable Dependabot security updates for an individual repository.

Enabling or disabling Dependabot security updates for an individual repository

  1. On your GitHub Enterprise Server instance, navigate to the main page of the repository.

  2. 在存储库名称下,单击 “设置”。 “存储库设置”按钮

  3. In the left sidebar, click Security & analysis. "Security & analysis" tab in repository settings

  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 security updates

Overriding the default behavior with a configuration file

You can override the default behavior of Dependabot security updates 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-requests-limit to 0 in order to prevent version updates for a given package-ecosystem. For more information, see "open-pull-requests-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