Configuring Dependabot security updates
You can use Dependabot security updates or manual pull requests to easily update vulnerable dependencies.
Who can use this feature?
Users withwrite access
In this article
About configuring Dependabot security updates
You can enable Dependabot security updates for any repository that uses Dependabot alerts and the dependency graph. For more information, seeAbout Dependabot security updates.
You can enable or disable Dependabot security updates for an individual repository or for all repositories owned by your personal account or organization. For more information about enabling security features in an organization, seeEnabling security features in your organization.
Note
When Dependabot security updates are enabled for a repository, Dependabot will automatically try to open pull requests to resolveevery open Dependabot alert that has an available patch. If you prefer to customize which alerts Dependabot opens pull requests for, you should leave Dependabot security updatesdisabled and create an auto-triage rule. For more information, seeCustomizing auto-triage rules to prioritize Dependabot alerts.
Dependabot and all related features are covered byGitHub's Terms of Service.
Supported repositories
GitHub automatically enables Dependabot security updates for newly created repositories if your personal account or organization has enabledAutomatically enable for new repositories for Dependabot security updates. For more information, seeManaging 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 us through theGitHub Support portal.
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, seeManaging security and analysis settings for your personal account orManaging 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
On GitHub, navigate to the main page of the repository.
Under your repository name, click Settings. If you cannot see the "Settings" tab, select the dropdown menu, then clickSettings.
In the "Security" section of the sidebar, click Code security.
Under "Code security", to the right of "Dependabot security updates", clickEnable to enable the feature orDisable to disable it. For public repositories, the button is disabled if the feature is always enabled.
Grouping Dependabot security updates into a single pull request
To reduce the number of pull requests you may be seeing, you can enable grouped security updates for your repository or organization. When this is enabled, Dependabot will group security updates into one pull request for each package ecosystem. In order to use grouped security updates, you must first enable the following features:
- Dependency graph. For more information, seeConfiguring the dependency graph.
- Dependabot alerts. For more information, seeConfiguring Dependabot alerts.
- Dependabot security updates. For more information, seeConfiguring Dependabot security updates.
Note
When grouped security updates are first enabled, Dependabot will immediately try to create grouped pull requests. You may notice Dependabot closing old pull requests and opening new ones.
You can enable grouped pull requests for Dependabot security updates in one, or both, of the following ways.
- To group as many available security updates together as possible, across directories and per ecosystem, enable grouping in the "Code security" settings for your repository, or in "Global settings" under Code security for your organization.
- For more granular control of grouping, such as grouping by package name, development/production dependencies, SemVer level, or across multiple directories per ecosystem, add configuration options to the
dependabot.yml
configuration file in your repository.
Note
If you have configured group rules for Dependabot security updates in adependabot.yml
file, all available updates will be grouped according to the rules you've specified. Dependabot will only group across those directories not configured in yourdependabot.yml
if the setting for grouped security updates at the organization or repository level is also enabled.
Enabling or disabling grouped Dependabot security updates for an individual repository
Repository administrators can enable or disable grouped security updates for their repository. Changing the repository setting will override any default organization settings. Group rules configured in adependabot.yml
file will override the user interface settings for enabling or disabling grouped security updates at the organization or repository level.
On GitHub, navigate to the main page of the repository.
Under your repository name, click Settings. If you cannot see the "Settings" tab, select the dropdown menu, then clickSettings.
In the "Security" section of the sidebar, click Code security.
Under "Code security", to the right of "Grouped security updates", clickEnable to enable the feature orDisable to disable it.
Enabling or disabling grouped Dependabot security updates for an organization
You can enable grouped Dependabot security updates into a single pull request. For more information, seeConfiguring global security settings for your organization.
Overriding the default behavior with a configuration file
You can override the default behavior of Dependabot security updates by adding adependabot.yml
file to your repository. With adependabot.yml
file, you can have more granular control of grouping, and override the default behavior of Dependabot security updates settings.
Use thegroups
option with theapplies-to: security-updates
key to create sets of dependencies (per package manager), so that Dependabot opens a single pull request to update multiple dependencies at the same time. You can define groups by package name (thepatterns
andexclude-patterns
keys), dependency type (dependency-type
key), and SemVer (theupdate-types
key).
Dependabot creates groups in the order they appear in yourdependabot.yml
file. If a dependency update could belong to more than one group, it is only assigned to the first group it matches with.
If you only requiresecurity updates and want to excludeversion updates, you can setopen-pull-requests-limit
to0
in order to prevent version updates for a givenpackage-ecosystem
.
For more information about the configuration options available for security updates, seeCustomizing pull requests for Dependabot security updates.
# Example configuration file that:# - Has a private registry# - Ignores lodash dependency# - Disables version-updates# - Defines a group by package name, for security updates for golang dependenciesversion: 2registries: example: type: npm-registry url: https://example.com token: ${{secrets.NPM_TOKEN}}updates: - package-ecosystem: "npm" directory: "/src/npm-project" schedule: interval: "daily" # For Lodash, ignore all updates ignore: - dependency-name: "lodash" # Disable version updates for npm dependencies open-pull-requests-limit: 0 registries: - example - package-ecosystem: "gomod" groups: golang: applies-to: security-updates patterns: - "golang.org*"
# Example configuration file that:# - Has a private registry# - Ignores lodash dependency# - Disables version-updates# - Defines a group by package name, for security updates for golang dependenciesversion:2registries:example:type:npm-registryurl:https://example.comtoken:${{secrets.NPM_TOKEN}}updates:-package-ecosystem:"npm"directory:"/src/npm-project"schedule:interval:"daily"# For Lodash, ignore all updatesignore:-dependency-name:"lodash"# Disable version updates for npm dependenciesopen-pull-requests-limit:0registries:-example-package-ecosystem:"gomod"groups:golang:applies-to:security-updatespatterns:-"golang.org*"
Note
In order for Dependabot to use this configuration for security updates, thedirectory
must be the path to the manifest files, and you should not specify atarget-branch
.