Dependabot options reference - GitHub Docs (original) (raw)

Detailed information for all the options you can use to customize how Dependabot maintains your repositories.

Who can use this feature?

About the dependabot.yml file

The dependabot.yml file defines how Dependabot maintains dependencies using version updates. In addition, all options marked with a icon also change how Dependabot creates pull requests for security updates, except where target-branch is used.

The Dependabot configuration file, dependabot.yml, uses YAML syntax. If you're new to YAML and want to learn more, see Learn YAML in five minutes.

You must store this file in the .github directory of your repository in the default branch. When you add or update the dependabot.yml file, this triggers an immediate check for version updates. For more information and an example, see Configuring Dependabot version updates.

Note

Dependabot alerts are configured in the repository or organization "Settings" tab and not in the dependabot.yml file, see Configuring Dependabot alerts.

Required keys

Key Location Purpose
version Top level Dependabot configuration syntax to use. Always: 2.
updates Top level Section where you define each package-ecosystem to update.
package-ecosystem Under updates Define a package manager to update.
directories or directory Under each package-ecosystem entry Define the location of the manifest or other definition files to update.
schedule.interval Under each package-ecosystem entry Define whether to look for version updates: daily, weekly, or monthly.

Optionally, you can also include a top-level registries key to define access details for private registries, see Top-level registries key.

YAML


# Basic `dependabot.yml` file with
# minimum configuration for two package managers

version: 2
updates:
  # Enable version updates for npm
  - package-ecosystem: "npm"
    # Look for `package.json` and `lock` files in the `root` directory
    directory: "/"
    # Check the npm registry for updates every day (weekdays)
    schedule:
      interval: "daily"

  # Enable version updates for Docker
  - package-ecosystem: "docker"
    # Look for a `Dockerfile` in the `root` directory
    directory: "/"
    # Check for updates once a week
    schedule:
      interval: "weekly"

For a real-world example of a dependabot.yml file, see Dependabot's own configuration file.

allow

Use to define exactly which dependencies to maintain for a package ecosystem. Often used with the ignore option. For examples, see Controlling which dependencies are updated by Dependabot.

Dependabot default behavior:

When allow is specified Dependabot uses the following process:

  1. Check for all explicitly allowed dependencies.
  2. Then filter out any ignored dependencies or versions.
    If a dependency is matched by an allow and an ignore statement, then it is ignored.
Parameters Purpose
dependency-name Allow updates for dependencies with matching names, optionally using * to match zero or more characters.
dependency-type Allow updates for dependencies of specific types.

dependency-name (allow)

For most package managers, you should define a value that will match the dependency name specified in the lock or manifest file. A few systems have more complex requirements.

Package manager Format required Example
Gradle and Maven groupId:artifactId org.kohsuke:github-api
Docker for image tags The full name of the repository For an image tag of .dkr.ecr.us-west-2.amazonaws.com/base/foo/bar/ruby:3.1.0-focal-jemalloc, use base/foo/bar/ruby.

dependency-type (allow)

Dependency types Supported by package managers Allow updates
direct All All explicitly defined dependencies.
indirect bundler, pip, composer, cargo, gomod Dependencies of direct dependencies (also known as sub-dependencies, or transient dependencies).
all All All explicitly defined dependencies. For bundler, pip, composer, cargo, gomod, also the dependencies of direct dependencies.
production bundler, composer, mix, maven, npm, pip (not all managers) Only to dependencies defined by the package manager as production dependencies.
development bundler, composer, mix, maven, npm, pip (not all managers) Only to dependencies defined by the package manager as development dependencies.

assignees

Specify individual assignees for all pull requests raised for a package ecosystem. For examples, see Customizing Dependabot pull requests to fit your processes.

Dependabot default behavior:

When assignees is defined:

Assignees must have write access to the repository. For organization-owned repositories, organization members with read access are also valid assignees.

commit-message

Define the format for commit messages. Since the titles of pull requests are written based on commit messages, this setting also impacts the titles of pull requests. For examples, see Customizing Dependabot pull requests to fit your processes.

Dependabot default behavior:

When commit-message is defined:

Parameters Purpose
prefix Defines a prefix for all commit messages and pull request titles.
prefix-development On supported systems, defines a different prefix to use for commits that update dependencies in the Development dependency group.
include Follow the commit message prefix with additional information.

Tip

When pull requests are raised for grouped updates, the branch name and pull request title are defined by the group IDENTIFIER, see groups.

prefix

prefix-development

Supported by: bundler, composer, mix, maven, npm, and pip.

include

directories or directory

Required option. Use to define the location of the package manifests for each package manager (for example, the package.json or Gemfile). Without this information Dependabot cannot create pull requests for version updates. For examples, see Defining multiple locations for manifest files.

If you need to use more than one block in the configuration file to define updates for a single target branch of an ecosystem, you must ensure that all values are unique and there is no overlap in directories defined.

Note

The directories key supports globbing and the wildcard character *. These features are not supported by the directory key.

enable-beta-ecosystems

Not currently in use.

groups

Define rules to create one or more sets of dependencies managed by a package manager, to group updates into fewer, targeted pull requests. For examples, see Optimizing the creation of pull requests for Dependabot version updates.

Dependabot default behavior:

When groups is used to define rules:

Parameters Purpose
IDENTIFIER Define an identifier for the group to use in branch names and pull request titles. This must start and end with a letter, and can contain letters, pipes |, underscores _, or hyphens -.
applies-to Specify which type of update the group applies to. When undefined, defaults to version updates. Supported values: version-updates or security-updates.
dependency-type Limit the group to a type. Supported values: development or production.
patterns Define one or more patterns to include dependencies with matching names.
exclude-patterns Define one or more patterns to exclude dependencies from the group.
update-types Limit the group to one or more semantic versioning levels. Supported values: minor, patch, and major.

dependency-type (groups)

Supported by: bundler, composer, mix, maven, npm, and pip.

By default, a group will include all types of dependencies.

patterns and exclude-patterns (groups)

Both options support using * as a wild card to define matches with dependency names. If a dependency matches both a pattern and an exclude-pattern, then it is excluded from the group.

update-types (groups)

By default, a group will include updates for all semantic versions (SemVer). SemVer is an accepted standard for defining versions of software packages, in the form x.y.z. Dependabot assumes that versions in this form are always major.minor.patch.

For examples, see Controlling which dependencies are updated by Dependabot.

ignore

Use with the allow option to define exactly which dependencies to maintain for a package ecosystem. Dependabot checks for all allowed dependencies and then filters out any ignored dependencies or versions. So a dependency that is matched by both an allow and an ignore will be ignored. For examples, see Controlling which dependencies are updated by Dependabot.

Dependabot default behavior:

When ignore is used Dependabot uses the following process:

  1. Check for all explicitly allowed dependencies.
  2. Then filter out any ignored dependencies or versions.
    If a dependency is matched by an allow and an ignore statement, then it is ignored.
Parameters Purpose
dependency-name Ignore updates for dependencies with matching names, optionally using * to match zero or more characters.
versions Ignore specific versions or ranges of versions.
update-types Ignore updates to one or more semantic versioning levels. Supported values: version-update:semver-minor, version-update:semver-patch, and version-update:semver-major.

dependency-name (ignore)

For most package managers, you should define a value that will match the dependency name specified in the lock or manifest file. A few systems have more complex requirements.

Package manager Format required Example
Gradle and Maven groupId:artifactId org.kohsuke:github-api
Docker for image tags The full name of the repository For an image tag of .dkr.ecr.us-west-2.amazonaws.com/base/foo/bar/ruby:3.1.0-focal-jemalloc, use base/foo/bar/ruby.

versions (ignore)

Use to ignore specific versions or ranges of versions. If you want to define a range, use the standard pattern for the package manager. For example:

For examples, see Controlling which dependencies are updated by Dependabot.

update-types (ignore)

Specify which semantic versions (SemVer) to ignore. SemVer is an accepted standard for defining versions of software packages, in the form x.y.z. Dependabot assumes that versions in this form are always major.minor.patch.

insecure-external-code-execution

Supported by: bundler, mix, and pip.

Allow Dependabot to execute external code in the manifest during updates. For examples, see Allowing external code execution.

Dependabot default behavior:

When you allow insecure-external-code-execution:

Supported value: allow.

labels

Specify your own labels for all pull requests raised for a package manager. For examples, see Customizing Dependabot pull requests to fit your processes.

Dependabot default behavior:

When labels is defined:

Setting this option will also affect pull requests for security updates to the manifest files of this package manager, unless you use target-branch to check for version updates on a non-default branch.

milestone

Associate all pull requests raised for a package manager with a milestone. For examples, see Customizing Dependabot pull requests to fit your processes.

Dependabot default behavior:

When milestone is defined:

Supported value: the numeric identifier of a milestone.

Tip

If you view a milestone, the final part of the page URL, after milestone, is the identifier. For example: https://github.com/<org>/<repo>/milestone/3, see Viewing your milestone's progress.

open-pull-requests-limit

Change the limit on the maximum number of pull requests for version updates open at any time.

Dependabot default behavior:

When open-pull-requests-limit is defined:

package-ecosystem

Required option. Define one package-ecosystem element for each package manager that you want Dependabot to monitor for new versions. The repository must also contain a dependency manifest or lock file for each package manager, see Example dependabot.yml file.

Package manager YAML value Supported versions
Bun bun >=v1.1.39
Bundler bundler v2
Cargo cargo v1
Composer composer v2
Dev containers devcontainers Not applicable
Docker docker v1
Docker Compose docker-compose v2, v3
.NET SDK dotnet-sdk >=.NET Core 3.1
Helm Charts helm v3
Hex mix v1
elm-package elm v0.19
git submodule gitsubmodule Not applicable
GitHub Actions github-actions Not applicable
Go modules gomod v1
Gradle gradle Not applicable
Maven maven Not applicable
npm npm v7, v8, v9
NuGet nuget <=6.12.0
pip pip v21.1.2
pip-compile pip 6.1.0
pipenv pip <= 2021-05-29
pnpm npm v7, v8 v9 (version updates only)
poetry pip v1
pub pub v2
Swift swift v5
Terraform terraform >= 0.13, <= 1.10.x
uv uv v0
yarn npm v1, v2, v3

pull-request-branch-name.separator

Specify a separator to use when generating branch names. For examples, see Customizing Dependabot pull requests to fit your processes.

Dependabot default behavior:

When pull-request-branch-name.separator is defined:

Supported values: "-", _, /

Tip

The hyphen symbol must be escaped so it is not interpreted as starting an empty YAML list.

rebase-strategy

Disable automatic rebasing of pull requests raised by Dependabot.

Dependabot default behavior is to rebase open pull requests when Dependabot detects any changes to a version or security update pull request. Dependabot checks for changes when:

When rebase-strategy is set to disabled, Dependabot stops rebasing pull requests.

Note

Pull requests that were open before you disable rebasing will continue to be rebased until 30 days after they were opened. This affects all pull requests that have conflicts with the target branch and all pull requests for version updates.

registries

Configure access to private package registries to allow Dependabot to update a wider range of dependencies, see Configuring access to private registries for Dependabot and Guidance for the configuration of private registries for Dependabot.

There are 2 locations in the dependabot.yml file where you can use the registries key:

  1. At the top level, where you define the private registries you want to use and their access information, see Configuring access to private registries for Dependabot.
  2. Within the updates blocks, where you can specify which private registries each package manager should use.

Dependabot default behavior is to raise pull requests only to update dependencies stored in publicly accessible registries.

When the Dependabot configuration file has a top-level registries section, defining access to one or more private registries, you can configure each package-ecosystem to use one or more of these private registries.

When registries is defined for a package manager:

Supported values: REGISTRY_NAME or "*"

reviewers

Specify individual reviewers, or teams of reviewers, for all pull requests raised for a package manager. For examples, see Customizing Dependabot pull requests to fit your processes.

Dependabot default behavior:

When reviewers is defined:

Reviewers must have at least read access to the repository.

schedule

Required option. Define how often to check for new versions for each package manager you configure using the interval parameter. Optionally, for daily and weekly intervals, you can customize when Dependabot checks for updates. For examples, see Optimizing the creation of pull requests for Dependabot version updates.

Parameters Purpose
interval Required. Defines the frequency for Dependabot.
day Specify the day to run for a weekly interval.
time Specify the time to run.
cronjob Defines the cron expression if the interval type is cron.
timezone Specify the timezone of the time value.

interval

Supported values: daily, weekly, monthly, quarterly, semiannually, yearly, or cron

Each package manager must define a schedule interval.

By default, Dependabot randomly assigns a time to apply all the updates in the configuration file. You can use the time and timezone parameters to set a specific runtime for all intervals. If you use a cron interval, you can define the update time with a cronjob expression.

day

Supported values: monday, tuesday, wednesday, thursday, friday, saturday, or sunday

Optionally, run weekly updates for a package manager on a specific day of the week.

time

Format: hh:mm

Optionally, run all updates for a package manager at a specific time of day. By default, times are interpreted as UTC.

cronjob

Supported values: Valid cron expression in cron format or natural expression.

Examples : 0 9 * * *, every day at 5pm

cron format is defined as the following:

0 9 * * * is equivalent to "every day at 9am". every day at 5pm is equivalent to 0 17 * * *.

Note

A cronjob type schedule is required to use a cron interval.

YAML


# Basic `dependabot.yml` file for cronjob

version: 2
updates:
  # Enable version updates for npm
  - package-ecosystem: "npm"
    # Look for `package.json` and `lock` files in the `root` directory
    directory: "/"
    # Check the npm registry for updates based on `cronjob` value
    schedule:
      interval: "cron"
      cronjob: "0 9 * * *"

timezone

Specify a time zone for the time value.

The time zone identifier must match a timezone in the database maintained by iana, see List of tz database time zones.

target-branch

Define a specific branch to check for version updates and to target pull requests for version updates against. For examples, see Customizing Dependabot pull requests to fit your processes.

Dependabot default behavior:

When target-branch is defined:

vendor

Supported by: bundler and gomod only.

Tell Dependabot to maintain your vendored dependencies as well as the dependencies defined by manifest files. A dependency is described as "vendored" or "cached" when you store the code within your repository, see bundle cache documentation and go mod vendor documentation.

For examples, see Controlling which dependencies are updated by Dependabot.

Dependabot default behavior:

When vendor is enabled:

Supported values: true or false

versioning-strategy

Supported by: bundler, cargo, composer, mix, npm, pip, pub

Define how Dependabot should edit manifest files. For examples, see Controlling which dependencies are updated by Dependabot.

Dependabot default behavior:

When versioning-strategy is defined, Dependabot uses the strategy specified.

Value Behavior
auto Default behavior.
increase Always increase the minimum version requirement to match the new version. If a range already exists, typically this only increases the lower bound.
increase-if-necessary Leave the constraint if the original constraint allows the new version, otherwise, bump the constraint.
lockfile-only Only create pull requests to update lockfiles. Ignore any new versions that would require package manifest changes.
widen Widen the allowed version requirements to include both the new and old versions, when possible. Typically, this only increases the maximum allowed version requirement.

For example, if the current version is 1.0.0 and the current constraint is ^1.0.0 the different strategies would raise the following updates:

New version 1.2.0

New version 2.0.0

Note

If the package manager you use does not yet support configuring the versioning-strategy parameter, or does not support a value you need. The strategy code is open source, so if you'd like a particular ecosystem to support a new strategy, you are always welcome to submit a pull request in https://github.com/dependabot/dependabot-core/.

Versioning tags

Dependabot recognizes a variety of versioning tags for pre-releases, stable versions, and custom tags across different ecosystems.

The dependabot.yml file doesn't control the versioning tags that you can use, but you can define in configuration options such as ignore the supported versioning tags you want to ignore updates for.

Supported versioning tags

Package Manager YAML value Supported Tags Examples
Maven maven alpha, a, beta, b, milestone, m, rc, cr, sp, ga, final, release, snapshot spring-security-web@5.6.0-SNAPSHOT, spring-core@5.2.0.RELEASE
npm npm alpha, beta, canary, dev, experimental, latest, legacy, next, nightly, rc, release, stable lodash@beta, react@latest, express@next
pnpm npm alpha, beta, canary, dev, experimental, latest, legacy, next, nightly, rc, release, stable lodash@1.2.0-alpha, react@alpha, vue@next
yarn npm alpha, beta, canary, dev, experimental, latest, legacy, next, nightly, rc, release, stable lodash@1.2.0-alpha, axios@latest, moment@nightly

Versioning tag glossary

Top-level registries key

Specify authentication details that Dependabot can use to access private package registries, including registries hosted by GitLab or Bitbucket.

The value of the registries key is an associative array, each element of which consists of a key that identifies a particular registry and a value which is an associative array that specifies the settings required to access that registry. The following dependabot.yml file configures a registry identified as dockerhub in the registries section of the file and then references this in the updates section of the file.

YAML

# Minimal settings to update dependencies stored in one private registry

version: 2
registries:
  dockerhub: # Define access for a private registry
    type: docker-registry
    url: registry.hub.docker.com
    username: octocat
    password: ${{secrets.DOCKERHUB_PASSWORD}}
updates:
  - package-ecosystem: "docker"
    directory: "/docker-registry/dockerhub"
    registries:
      - dockerhub # Allow version updates for dependencies in this registry
    schedule:
      interval: "monthly"

You use the following options to specify access settings. Registry settings must contain a type and a url, and typically either a username and password combination or a token.

Parameters Purpose
REGISTRY_NAME Required: Defines an identifier for the registry.
type Required: Identifies the type of registry.
Authentication details Required: The parameters supported for supplying authentication details vary for registries of different types.
url Required: The URL to use to access the dependencies in this registry. The protocol is optional. If not specified, https:// is assumed. Dependabot adds or ignores trailing slashes as required.
replaces-base If the boolean value is true, Dependabot resolves dependencies using the specified url rather than the base URL of that ecosystem.

For in-depth information about available options, as well as recommendations and advice when configuring private registries, see Guidance for the configuration of private registries for Dependabot.

type and authentication details

The parameters used to provide authentication details for access to a private registry vary according to the registry type.

Registry type Required authentication parameters
cargo-registry token
composer-repository username and password
docker-registry username and password
git username and password
hex-organization organization and key
hex-repository repo and auth-key optionally with the corresponding public-key-fingerprint
maven-repository username and password
npm-registry username and passwordor token
nuget-feed username and passwordor token
pub-registry token
python-index username and passwordor token
rubygems-server username and passwordor token
terraform-registry token

All sensitive data used for authentication should be stored securely and referenced from that secure location, see Configuring access to private registries for Dependabot.

Tip

If the account is a GitHub account, you can use a GitHub personal access token in place of the password.

url and replaces-base

The url parameter defines where to access a registry. When the optional replaces-base parameter is enabled (true), Dependabot resolves dependencies using the value of url rather than the base URL of that specific ecosystem.