|
| 1 | +--- |
| 2 | +title: About the dependabot.yml file |
| 3 | +intro: 'The `dependabot.yml` controls automated dependency updates in your repository.' |
| 4 | +allowTitleToDifferFromFilename: true |
| 5 | +versions: |
| 6 | + fpt: '*' |
| 7 | + ghec: '*' |
| 8 | + ghes: '*' |
| 9 | +topics: |
| 10 | + - Dependabot |
| 11 | + - Vulnerabilities |
| 12 | + - Repositories |
| 13 | + - Dependencies |
| 14 | +shortTitle: dependabot.yml file |
| 15 | +contentType: concepts |
| 16 | +--- |
| 17 | + |
| 18 | +The `dependabot.yml` file is an optional configuration file that gives you fine-grained control over how {% data variables.product.prodname_dependabot %} monitors and updates dependencies (mainly _version updates_ but also _security updates_) in your repository. |
| 19 | + |
| 20 | +Without a `dependabot.yml` file, {% data variables.product.prodname_dependabot %} can still create security updates for vulnerable dependencies if you've enabled {% data variables.product.prodname_dependabot_security_updates %} in your repository settings. However, you won't receive automated version updates or have control over update schedules and other configuration options. |
| 21 | + |
| 22 | +The `dependabot.yml` file uses YAML syntax. If you're new to YAML and want to learn more, see [Learn YAML in five minutes](https://www.codeproject.com/Articles/1214409/Learn-YAML-in-five-minutes). |
| 23 | + |
| 24 | +> [!NOTE] |
| 25 | +> {% data variables.product.prodname_dependabot_alerts %} are configured in the repository or organization "Settings" tab and not in the `dependabot.yml` file, see [AUTOTITLE](/code-security/dependabot/dependabot-alerts/configuring-dependabot-alerts). |
| 26 | +
|
| 27 | +## What the `dependabot.yml` file does |
| 28 | + |
| 29 | +The `dependabot.yml` file controls how {% data variables.product.prodname_dependabot %} performs updates on your dependencies. With this file, you can: |
| 30 | + |
| 31 | +### For version updates |
| 32 | + |
| 33 | +* Enable automated version updates |
| 34 | +* Specify which package ecosystems and directories to monitor |
| 35 | +* Set update schedules |
| 36 | +* Customize pull request labels, assignees, reviewers, and commit messages |
| 37 | +* Control which dependencies to update or ignore |
| 38 | +* Configure authentication for private registries |
| 39 | + |
| 40 | +### For security updates |
| 41 | + |
| 42 | +* Customize security update pull requests with labels, assignees, and reviewers |
| 43 | +* Define target branches for security updates |
| 44 | +* Configure private registry authentication |
| 45 | +* Set limits on open pull requests |
| 46 | + |
| 47 | +## Where to store the `dependabot.yml` file |
| 48 | + |
| 49 | +You must store this file in the `.github` directory of your repository in the default branch (typically `main`). The path is: `.github/dependabot.yml`. |
| 50 | + |
| 51 | +## How the `dependabot.yml` file works |
| 52 | + |
| 53 | +When you add or update the `dependabot.yml` file in your repository, {% data variables.product.prodname_dependabot %} reads the configuration and begins monitoring the specified package ecosystems according to your defined schedules. When {% data variables.product.prodname_dependabot %} finds available updates, it creates pull requests with the dependency changes, following any customization rules you've specified in the configuration. |
| 54 | + |
| 55 | +The configuration file requires the following keys for each package ecosystem to monitor. |
| 56 | + |
| 57 | +- **`version`**: Top-level field that specifies the Dependabot configuration syntax version. |
| 58 | +- **`updates`**: Top-level section where you define each package ecosystem to monitor for updates. |
| 59 | +- **`package-ecosystem`**: Defined under `updates`, specifies which package manager to update (such as npm, pip, or Docker). |
| 60 | +- **`directories` or `directory`**: Defined under each `package-ecosystem` entry, specifies the location of manifest or dependency definition files. |
| 61 | +- **`schedule.interval`**: Defined under each `package-ecosystem` entry, sets how often to check for version updates (`daily`, `weekly`, or `monthly`). |
| 62 | + |
| 63 | +## Basic example |
| 64 | + |
| 65 | +Here's a minimal `dependabot.yml` file that monitors npm dependencies daily: |
| 66 | + |
| 67 | +```yaml copy |
| 68 | +version: 2 |
| 69 | +updates: |
| 70 | + - package-ecosystem: "npm" |
| 71 | + directory: "/" |
| 72 | + schedule: |
| 73 | + interval: "daily" |
| 74 | +``` |
| 75 | +
|
| 76 | +## Next step |
| 77 | +
|
| 78 | +* Configure your repository so that Dependabot automatically updates the packages you use, see [AUTOTITLE](/code-security/how-tos/secure-your-supply-chain/secure-your-dependencies/configuring-dependabot-version-updates) |
0 commit comments