Learn how to streamline and efficiently manage your Dependabot pull requests.
By default, Dependabot opens a new pull request to update each dependency. When you enable security updates, new pull requests are opened when a vulnerable dependency is found. When you configure version updates for one or more ecosystems, new pull requests are opened when new versions of dependencies are available, with the frequency defined in the dependabot.yml file.
If your project has many dependencies, you might find that you have a very large number of Dependabot pull requests to review and merge, which can quickly become difficult to manage.
There are a couple of customization options you can implement to optimize Dependabot update pull requests to align with your processes, such as:
schedule.groups.Dependabot runs its checks for version updates at a frequency set by you in the configuration file, where the required field, schedule.interval, must be set to daily, weekly, monthly, quarterly, semiannually, yearly, or cron (see cronjob).
By default, Dependabot balances its workload by assigning a random time to check and raise pull requests for dependency updates.
However, to reduce distraction, or to better organize time and resources for reviewing and addressing version updates, you might find it useful to modify the frequency and timings. For example, you may prefer Dependabot to run weekly rather than daily checks for updates, and at a time that ensures pull requests are raised before for your team's triage session.
You can use schedule with a combination of options to modify the frequency and timings of when Dependabot checks for version updates.
The example dependabot.yml file below changes the npm configuration to specify that Dependabot should check for version updates to npm dependencies every Tuesday at 02:00 Japanese Standard Time (UTC +09:00).
# `dependabot.yml` file with
# customized schedule for version updates
version: 2
updates:
# Keep npm dependencies up to date
- package-ecosystem: "npm"
directory: "/"
# Check the npm registry every week on Tuesday at 02:00 Japan Standard Time (UTC +09:00)
schedule:
interval: "weekly"
day: "tuesday"
time: "02:00"
timezone: "Asia/Tokyo"
See also schedule.
You can use cooldown with a combination of options to control when Dependabot creates pull requests for version updates, but not security updates.
By default, Dependabot applies a cooldown period of 3 days to version updates, so a new version is not considered for a version update until 3 days after its release. This default cooldown does not apply to security updates.
The example dependabot.yml file below shows a cooldown period being applied to the dependencies requests, numpy, and those prefixed with pandas or django, but not to the dependency called pandas (exact match), which is excluded via the exclude list.
version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
cooldown:
default-days: 5
semver-major-days: 30
semver-minor-days: 7
semver-patch-days: 3
include:
- "requests"
- "numpy"
- "pandas*"
- "django"
exclude:
- "pandas"
include and exclude lists, which can be used with cooldown, is 150 each.Note
To consider all dependencies for a cooldown period, you can:
include option which applies cooldown to all dependencies."*" in include to apply the cooldown settings to everything.exclude to only exclude specific dependencies from cooldown settings.SemVer is supported for most package managers. Updates to new versions for dependencies in cooldown are deferred as follows:
semver-major-days: 30).semver-minor-days: 7).semver-patch-days: 3).See also cooldown.
You can use groups to consolidate updates for multiple dependencies into a single pull request. This helps you focus your review time on higher risk updates, and minimize the time spent reviewing minor version updates. For example, you can combine updates for minor or patch updates for development dependencies into a single pull request, and have a dedicated group for security or version updates that impact a key area of your codebase.
You must configure groups per individual package ecosystem, then you can create multiple groups per package ecosystem using a combination of criteria:
applies-todependency-type.patterns and exclude-patternsupdate-typesTo see all supported values for each criterion, see groups.
The below examples present several different methods to create groups of dependencies using the criteria.
In this example, the dependabot.yml file:
production-dependencies", "development-dependencies", and "rubocop".patterns and dependency-type to include dependencies in the group.exclude-patterns to exclude a dependency (or multiple dependencies) from the group.version: 2
updates:
# Keep bundler dependencies up to date
- package-ecosystem: "bundler"
directory: "/"
schedule:
interval: "weekly"
groups:
production-dependencies:
dependency-type: "production"
development-dependencies:
dependency-type: "development"
exclude-patterns:
- "rubocop*"
rubocop:
patterns:
- "rubocop*"
As a result:
rubocop* are excluded from the development-dependencies group.rubocop* will be included in the rubocop group. Due to the ordering, production dependencies matching rubocop* will be included in the production-dependencies group.applies-to key is absent.In this example, the dependabot.yml file:
support-dependencies," as part of a customized Bundler configuration.patterns that match with the name of a dependency (or multiple dependencies) to include dependencies in the group.exclude-patterns that match with the name of a dependency (or multiple dependencies) to exclude dependencies from the group.applies-to: version-updates is used.version: 2
updates:
# Keep bundler dependencies up to date
- package-ecosystem: "bundler"
directories:
- "/frontend"
- "/backend"
- "/admin"
schedule:
interval: "weekly"
# Create a group of dependencies to be updated together in one pull request
groups:
# Specify a name for the group, which will be used in pull request titles
# and branch names
support-dependencies:
# Define patterns to include dependencies in the group (based on
# dependency name)
applies-to: version-updates # Applies the group rule to version updates
patterns:
- "rubocop" # A single dependency name
- "rspec*" # A wildcard string that matches multiple dependency names
- "*" # A wildcard that matches all dependencies in the package
# ecosystem. Note: using "*" may open a large pull request
# Define patterns to exclude dependencies from the group (based on
# dependency name)
exclude-patterns:
- "gc_ruboconfig"
- "gocardless-*"
As a result:
support-dependencies group due to the wildcard ("*") pattern, apart fromgc_ruboconfig and gocardless-* are excluded from the group, and Dependabot continues to raise single pull requests for these dependencies. This can be helpful if updates for these dependencies need to be reviewed with closer scrutiny.support-dependencies, Dependabot will only raise pull requests for version updates.In this example, the dependabot.yml file:
angular."patterns that match with the name of a dependency to include dependencies in the group.update-type to only include minor or patch updates in the group.applies-to: version-updates is used.version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
groups:
# Specify a name for the group, which will be used in pull request titles
# and branch names
angular:
applies-to: version-updates
patterns:
- "@angular*"
update-types:
- "minor"
- "patch"
As a result:
In this example, the dependabot.yml file:
angular" and "minor-and-patch".applies-to so that the first group applies to version updates only, and the second group applies to security updates only.update-type to only include minor or patch updates for both groups.ignore condition to exclude updates to major versions of @angular* packages.version: 2
updates:
# Keep npm dependencies up to date
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
groups:
angular:
applies-to: version-updates
patterns:
- "@angular*"
update-types:
- "minor"
- "patch"
minor-and-patch:
applies-to: security-updates
patterns:
- "@angular*"
update-types:
- "patch"
- "minor"
ignore:
- dependency-name: "@angular*"
update-types: ["version-update:semver-major"]
As a result:
If you manage a monorepo with multiple directories that share common dependencies, you can reduce the number of pull requests for version updates by grouping updates by dependency name across all directories.
When you configure Dependabot to monitor multiple directories and enable grouping by dependency name, Dependabot will:
For more information, see group-by.
This configuration example groups updates by dependency name across the /frontend, /admin-panel, and /mobile-app directories. If lodash needs to be updated in all three directories, Dependabot will create a single pull request named "Bump lodash in monorepo-dependencies group" that updates lodash in all three locations.
version: 2
updates:
- package-ecosystem: "npm"
directories:
- "/frontend"
- "/admin-panel"
- "/mobile-app"
schedule:
interval: "weekly"
groups:
monorepo-dependencies:
group-by: dependency-name