Note: Dependabot security and version updates are currently in private beta and subject to change. Please contact your account management team for instructions on enabling Dependabot updates.
Observação: o administrador do site precisa configurar as Dependabot updates do your GitHub Enterprise Server instance para que você possa usar esse recurso. Para obter mais informações, confira "Como habilitar o Dependabot para sua empresa".
After you've enabled version updates, you can customize how Dependabot maintains your dependencies by adding further options to the dependabot.yml file. For example, you could:
- Specify which day of the week to open pull requests for version updates:
- Set reviewers, assignees, and labels for each package manager:
- Define a versioning strategy for changes to each manifest file:
- Change the maximum number of open pull requests for version updates from the default of 5:
- Open pull requests for version updates to target a specific branch, instead of the default branch:
For more information about the configuration options, see "Configuration options for the dependabot.yml file."
When you update the dependabot.yml file in your repository, Dependabot runs an immediate check with the new configuration. Within minutes you will see an updated list of dependencies on the Dependabot tab, this may take longer if the repository has many dependencies. You may also see new pull requests for version updates. For more information, see "Listing dependencies configured for version updates."
If you customize the dependabot.yml file, you may notice some changes to the pull requests raised for security updates. These pull requests are always triggered by a security advisory for a dependency, rather than by the Dependabot schedule. However, they inherit relevant configuration settings from the dependabot.yml file unless you specify a different target branch for version updates.
For an example, see "Setting custom labels" below.
When you set a
daily update schedule, by default, Dependabot checks for new versions at 05:00 UTC. You can use
schedule.time to specify an alternative time of day to check for updates (format:
The example dependabot.yml file below expands the npm configuration to specify when Dependabot should check for version updates to dependencies.
# 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 for updates at 2am UTC schedule: interval: "daily" time: "02:00"
By default, Dependabot raises pull requests without any reviewers or assignees.
You can use
assignees to specify reviewers and assignees for all pull requests raised for a package manager. When you specify a team, you must use the full team name, as if you were @mentioning the team (including the organization).
The example dependabot.yml file below changes the npm configuration so that all pull requests opened with version and security updates for npm will have two reviewers and one assignee.
# dependabot.yml file with # reviews and an assignee for all npm pull requests version: 2 updates: # Keep npm dependencies up to date - package-ecosystem: "npm" directory: "/" schedule: interval: "weekly" # Raise all npm pull requests with reviewers reviewers: - "my-org/team-name" - "octocat" # Raise all npm pull requests with an assignee assignees: - "user-name"
Por padrão, o Dependabot gera todas as solicitações de pull com o rótulo
dependencies. Se mais de um gerenciador de pacotes for definido, o Dependabot incluirá um rótulo adicional em cada solicitação de pull. Isso indica a linguagem ou o ecossistema em que a solicitação de pull será atualizada, por exemplo,
java para atualizações do Gradle e
submodules para atualizações do Git Submodule. Dependabot cria essas etiquetas padrão automaticamente, conforme necessário no seu repositório.
You can use
labels to override the default labels and specify alternative labels for all pull requests raised for a package manager. You can't create new labels in the dependabot.yml file, so the alternative labels must already exist in the repository.
The example dependabot.yml file below changes the npm configuration so that all pull requests opened with version and security updates for npm will have custom labels. It also changes the Docker configuration to check for version updates against a custom branch and to raise pull requests with custom labels against that custom branch. The changes to Docker will not affect security update pull requests because security updates are always made against the default branch.
Note: The new
target-branch must contain a Dockerfile to update, otherwise this change will have the effect of disabling version updates for Docker.
# dependabot.yml file with # customized npm configuration version: 2 updates: # Keep npm dependencies up to date - package-ecosystem: "npm" directory: "/" schedule: interval: "weekly" # Raise all npm pull requests with custom labels labels: - "npm dependencies" - "triage-board" # Keep Docker dependencies up to date - package-ecosystem: "docker" directory: "/" schedule: interval: "weekly" # Raise pull requests for Docker version updates # against the "develop" branch. The Docker configuration # no longer affects security update pull requests. target-branch: "develop" # Use custom labels on pull requests for Docker version updates labels: - "Docker dependencies" - "triage-board"
For more examples, see "Configuration options for the dependabot.yml file."