1
---
2
name: dependabot
3
description: >-
4
Comprehensive guide for configuring and managing GitHub Dependabot. Use this skill when
5
users ask about creating or optimizing dependabot.yml files, managing Dependabot pull requests,
6
configuring dependency update strategies, setting up grouped updates, monorepo patterns,
7
multi-ecosystem groups, security update configuration, auto-triage rules, or any GitHub
8
Advanced Security (GHAS) supply chain security topic related to Dependabot. For pre-commit
9
dependency vulnerability scanning in AI coding agents via the GitHub MCP Server, this skill
10
references the Advanced Security plugin (`advanced-security@copilot-plugins`). Use this skill
11
when an agent needs to scan dependencies for known vulnerabilities before committing.
12
---
13
14
# Dependabot Configuration & Management
15
16
## Overview
17
18
Dependabot is GitHub's built-in dependency management tool with three core capabilities:
19
20
1. **Dependabot Alerts** — Notify when dependencies have known vulnerabilities (CVEs)
21
2. **Dependabot Security Updates** — Auto-create PRs to fix vulnerable dependencies
22
3. **Dependabot Version Updates** — Auto-create PRs to keep dependencies current
23
24
All configuration lives in a **single file**: `.github/dependabot.yml` on the default branch. GitHub does **not** support multiple `dependabot.yml` files per repository.
25
26
## Configuration Workflow
27
28
Follow this process when creating or optimizing a `dependabot.yml`:
29
30
### Step 1: Detect All Ecosystems
31
32
Scan the repository for dependency manifests. Look for:
33
34
| Ecosystem | YAML Value | Manifest Files |
35
|---|---|---|
36
| npm/pnpm/yarn | `npm` | `package.json`, `package-lock.json`, `pnpm-lock.yaml`, `yarn.lock` |
37
| pip/pipenv/poetry | `pip` | `requirements.txt`, `Pipfile`, `pyproject.toml`, `setup.py` |
38
| uv | `uv` | `pyproject.toml`, `uv.lock` |
39
| Docker | `docker` | `Dockerfile` |
40
| Docker Compose | `docker-compose` | `docker-compose.yml` |
41
| GitHub Actions | `github-actions` | `.github/workflows/*.yml` |
42
| Go modules | `gomod` | `go.mod` |
43
| Bundler (Ruby) | `bundler` | `Gemfile` |
44
| Cargo (Rust) | `cargo` | `Cargo.toml` |
45
| Composer (PHP) | `composer` | `composer.json` |
46
| NuGet (.NET) | `nuget` | `*.csproj`, `packages.config` |
47
| .NET SDK | `dotnet-sdk` | `global.json` |
48
| Maven (Java) | `maven` | `pom.xml` |
49
| Gradle (Java) | `gradle` | `build.gradle` |
50
| Terraform | `terraform` | `*.tf` |
51
| OpenTofu | `opentofu` | `*.tf` |
52
| Helm | `helm` | `Chart.yaml` |
53
| Hex (Elixir) | `mix` | `mix.exs` |
54
| Swift | `swift` | `Package.swift` |
55
| Pub (Dart) | `pub` | `pubspec.yaml` |
56
| Bun | `bun` | `bun.lockb` |
57
| Dev Containers | `devcontainers` | `devcontainer.json` |
58
| Git Submodules | `gitsubmodule` | `.gitmodules` |
59
| Pre-commit | `pre-commit` | `.pre-commit-config.yaml` |
60
61
Notes:
62
- pnpm and yarn both use the `npm` ecosystem value.
63
- Prefer `uv` ecosystem value when `uv.lock` is present; otherwise use `pip`.
64
65
### Step 2: Map Directory Locations
66
67
For each ecosystem, identify where manifests live. Use `directories` (plural) with glob patterns for monorepos:
68
69
```yaml
70
directories:
71
- "/" # root
72
- "/apps/*" # all app subdirs
73
- "/packages/*" # all package subdirs
74
- "/lib-*" # dirs starting with lib-
75
- "**/*" # recursive (all subdirs)
76
```
77
78
Important: `directory` (singular) does NOT support globs. Use `directories` (plural) for wildcards.
79
80
### Step 3: Configure Each Ecosystem Entry
81
82
Every entry needs at minimum:
83
84
```yaml
85
- package-ecosystem: "npm"
86
directory: "/"
87
schedule:
88
interval: "weekly"
89
```
90
91
### Step 4: Optimize with Grouping, Labels, and Scheduling
92
93
See sections below for each optimization technique.
94
95
## Monorepo Strategies
96
97
### Glob Patterns for Workspace Coverage
98
99
For monorepos with many packages, use glob patterns to avoid listing each directory:
100
101
```yaml
102
- package-ecosystem: "npm"
103
directories:
104
- "/"
105
- "/apps/*"
106
- "/packages/*"
107
- "/services/*"
108
schedule:
109
interval: "weekly"
110
```
111
112
### Cross-Directory Grouping
113
114
Use `group-by: dependency-name` to create a single PR when the same dependency updates across multiple directories:
115
116
```yaml
117
groups:
118
monorepo-deps:
119
group-by: dependency-name
120
```
121
122
This creates one PR per dependency across all specified directories, reducing CI costs and review burden.
123
124
Limitations:
125
- All directories must use the same package ecosystem
126
- Applies to version updates only
127
- Incompatible version constraints create separate PRs
128
129
### Standalone Packages Outside Workspaces
130
131
If a directory has its own lockfile and is NOT part of the workspace (e.g., scripts in `.github/`), create a separate ecosystem entry for it.
132
133
## Dependency Grouping
134
135
Reduce PR noise by grouping related dependencies into single PRs.
136
137
### By Dependency Type
138
139
```yaml
140
groups:
141
dev-dependencies:
142
dependency-type: "development"
143
update-types: ["minor", "patch"]
144
production-dependencies:
145
dependency-type: "production"
146
update-types: ["minor", "patch"]
147
```
148
149
### By Name Pattern
150
151
```yaml
152
groups:
153
angular:
154
patterns: ["@angular*"]
155
update-types: ["minor", "patch"]
156
testing:
157
patterns: ["jest*", "@testing-library*", "ts-jest"]
158
```
159
160
### For Security Updates
161
162
```yaml
163
groups:
164
security-patches:
165
applies-to: security-updates
166
patterns: ["*"]
167
update-types: ["patch", "minor"]
168
```
169
170
Key behaviors:
171
- Dependencies matching multiple groups go to the **first** match
172
- `applies-to` defaults to `version-updates` when absent
173
- Ungrouped dependencies get individual PRs
174
175
## Multi-Ecosystem Groups
176
177
Combine updates across different package ecosystems into a single PR:
178
179
```yaml
180
version: 2
181
182
multi-ecosystem-groups:
183
infrastructure:
184
schedule:
185
interval: "weekly"
186
labels: ["infrastructure", "dependencies"]
187
188
updates:
189
- package-ecosystem: "docker"
190
directory: "/"
191
patterns: ["nginx", "redis"]
192
multi-ecosystem-group: "infrastructure"
193
194
- package-ecosystem: "terraform"
195
directory: "/"
196
patterns: ["aws*"]
197
multi-ecosystem-group: "infrastructure"
198
```
199
200
The `patterns` key is required when using `multi-ecosystem-group`.
201
202
## PR Customization
203
204
### Labels
205
206
```yaml
207
labels:
208
- "dependencies"
209
- "npm"
210
```
211
212
Set `labels: []` to disable all labels including defaults. SemVer labels (`major`, `minor`, `patch`) are always applied if present in the repo.
213
214
### Commit Messages
215
216
```yaml
217
commit-message:
218
prefix: "deps"
219
prefix-development: "deps-dev"
220
include: "scope" # adds deps/deps-dev scope after prefix
221
```
222
223
### Assignees and Milestones
224
225
```yaml
226
assignees: ["security-team-lead"]
227
milestone: 4 # numeric ID from milestone URL
228
```
229
230
### Branch Name Separator
231
232
```yaml
233
pull-request-branch-name:
234
separator: "-" # default is /
235
```
236
237
### Target Branch
238
239
```yaml
240
target-branch: "develop" # PRs target this instead of default branch
241
```
242
243
Note: When `target-branch` is set, security updates still target the default branch; all ecosystem config only applies to version updates.
244
245
## Schedule Optimization
246
247
### Intervals
248
249
Supported: `daily`, `weekly`, `monthly`, `quarterly`, `semiannually`, `yearly`, `cron`
250
251
```yaml
252
schedule:
253
interval: "weekly"
254
day: "monday" # for weekly only
255
time: "09:00" # HH:MM format
256
timezone: "America/New_York"
257
```
258
259
### Cron Expressions
260
261
```yaml
262
schedule:
263
interval: "cron"
264
cronjob: "0 9 * * 1" # Every Monday at 9 AM
265
```
266
267
### Cooldown Periods
268
269
Delay updates for newly released versions to avoid early-adopter issues:
270
271
```yaml
272
cooldown:
273
default-days: 5
274
semver-major-days: 30
275
semver-minor-days: 7
276
semver-patch-days: 3
277
include: ["*"]
278
exclude: ["critical-lib"]
279
```
280
281
Cooldown applies to version updates only, not security updates.
282
283
## Security Updates Configuration
284
285
### Enable via Repository Settings
286
287
Settings → Advanced Security → Enable Dependabot alerts, security updates, and grouped security updates.
288
289
### Group Security Updates in YAML
290
291
```yaml
292
groups:
293
security-patches:
294
applies-to: security-updates
295
patterns: ["*"]
296
update-types: ["patch", "minor"]
297
```
298
299
### Disable Version Updates (Security Only)
300
301
```yaml
302
open-pull-requests-limit: 0 # disables version update PRs
303
```
304
305
### Auto-Triage Rules
306
307
GitHub presets auto-dismiss low-impact alerts for development dependencies. Custom rules can filter by severity, package name, CWE, and more. Configure in repository Settings → Advanced Security.
308
309
## PR Comment Commands
310
311
Interact with Dependabot PRs using `@dependabot` comments.
312
313
> **Note:** As of January 2026, merge/close/reopen commands have been deprecated.
314
> Use GitHub's native UI, CLI (`gh pr merge`), or auto-merge instead.
315
316
| Command | Effect |
317
|---|---|
318
| `@dependabot rebase` | Rebase the PR |
319
| `@dependabot recreate` | Recreate the PR from scratch |
320
| `@dependabot ignore this dependency` | Close and never update this dependency |
321
| `@dependabot ignore this major version` | Ignore this major version |
322
| `@dependabot ignore this minor version` | Ignore this minor version |
323
| `@dependabot ignore this patch version` | Ignore this patch version |
324
325
For grouped PRs, additional commands:
326
- `@dependabot ignore DEPENDENCY_NAME` — ignore specific dependency in group
327
- `@dependabot unignore DEPENDENCY_NAME` — clear ignores, reopen with updates
328
- `@dependabot unignore *` — clear all ignores for all dependencies in group
329
- `@dependabot show DEPENDENCY_NAME ignore conditions` — display current ignores
330
331
For the complete command reference, see `references/pr-commands.md`.
332
333
## Ignore and Allow Rules
334
335
### Ignore Specific Dependencies
336
337
```yaml
338
ignore:
339
- dependency-name: "lodash"
340
- dependency-name: "@types/node"
341
update-types: ["version-update:semver-patch"]
342
- dependency-name: "express"
343
versions: ["5.x"]
344
```
345
346
### Allow Only Specific Types
347
348
```yaml
349
allow:
350
- dependency-type: "production"
351
- dependency-name: "express"
352
```
353
354
Rule: If a dependency matches both `allow` and `ignore`, it is **ignored**.
355
356
### Exclude Paths
357
358
```yaml
359
exclude-paths:
360
- "vendor/**"
361
- "test/fixtures/**"
362
```
363
364
## Advanced Options
365
366
### Versioning Strategy
367
368
Controls how Dependabot edits version constraints:
369
370
| Value | Behavior |
371
|---|---|
372
| `auto` | Default — increase for apps, widen for libraries |
373
| `increase` | Always increase minimum version |
374
| `increase-if-necessary` | Only change if current range excludes new version |
375
| `lockfile-only` | Only update lockfiles, ignore manifests |
376
| `widen` | Widen range to include both old and new versions |
377
378
### Rebase Strategy
379
380
```yaml
381
rebase-strategy: "disabled" # stop auto-rebasing
382
```
383
384
Dependabot stops rebasing a PR once anyone else pushes a commit to its branch. A `[dependabot skip]` in that commit's message lifts that stop (it does not override `rebase-strategy: "disabled"`): the next rebase force-pushes over the branch, which discards the commit. Leave the marker out to keep your commit.
385
386
### Open PR Limit
387
388
```yaml
389
open-pull-requests-limit: 10 # default is 5 for version, 10 for security
390
```
391
392
Set to `0` to disable version updates entirely.
393
394
### Private Registries
395
396
```yaml
397
registries:
398
npm-private:
399
type: npm-registry
400
url: https://npm.example.com
401
token: ${{secrets.NPM_TOKEN}}
402
403
updates:
404
- package-ecosystem: "npm"
405
directory: "/"
406
registries:
407
- npm-private
408
```
409
410
## FAQ
411
412
**Can I have multiple `dependabot.yml` files?**
413
No. GitHub supports exactly one file at `.github/dependabot.yml`. Use multiple `updates` entries within that file for different ecosystems and directories.
414
415
**Does Dependabot support pnpm?**
416
Yes. Use `package-ecosystem: "npm"` — Dependabot detects `pnpm-lock.yaml` automatically.
417
418
**How do I reduce PR noise in a monorepo?**
419
Use `groups` to batch updates, `directories` with globs for coverage, and `group-by: dependency-name` for cross-directory grouping. Consider `monthly` or `quarterly` intervals for low-priority ecosystems.
420
421
**How do I handle dependencies outside the workspace?**
422
Create a separate ecosystem entry with its own `directory` pointing to that location.
423
424
## Pre-Commit Dependency Scanning via AI Coding Agents
425
426
For scanning code changes for vulnerable dependencies inside an AI coding agent before committing, the GitHub MCP Server's `dependabot` toolset can check your dependency additions against the GitHub Advisory Database and return structured results with affected packages, severity, and recommended fixed versions. For more thorough post-commit checks, it can also run the Dependabot CLI locally to diff dependency graphs before and after your changes.
427
428
Install the **Advanced Security plugin** which provides dedicated dependency scanning tools and the `/dependency-scanning` skill.
429
430
**GitHub Copilot CLI (shell):**
431
```bash
432
# Enable the dependabot toolset for the GitHub MCP Server
433
copilot --add-github-mcp-toolset dependabot
434
```
435
436
**GitHub Copilot CLI (inside `copilot`):**
437
```text
438
> /plugin install advanced-security@copilot-plugins
439
```
440
441
**Visual Studio Code:**
442
- Add `"X-MCP-Toolsets": "dependabot"` to your GitHub MCP Server headers, or pick **Dependabot** from the toolset selector in Copilot Chat
443
- Install the `advanced-security` plugin, then use `/dependency-scanning` in Copilot Chat
444
445
**Example prompt:**
446
> Scan the dependencies I added on this branch for known vulnerabilities and tell me which versions to upgrade to before I commit.
447
448
See: [Advanced Security Plugin — Dependency Scanning Skill](https://github.com/github/copilot-plugins/blob/main/plugins/advanced-security/skills/dependency-scanning/SKILL.md)
449
450
> Announced in [Dependency scanning with GitHub MCP Server is in public preview](https://github.blog/changelog/2026-05-05-dependency-scanning-with-github-mcp-server-is-in-public-preview/) (May 2026)
451
452
## Resources
453
454
- `references/dependabot-yml-reference.md` — Complete YAML options reference
455
- `references/pr-commands.md` — Full PR comment commands reference
456
- `references/example-configs.md` — Real-world configuration examples
457