dependabot
它能做什么
Dependabot 是 GitHub 提供的一个工具,可以帮你保持项目代码库(依赖项)的最新状态,并确保其安全。它可以在发现安全问题时提醒你,也可以自动创建更新。
适用场景
- ✓当你想在依赖项存在安全漏洞时收到通知。
- ✓想要自动把旧的代码库更新到较新的版本。
- ✓想要规范项目中依赖项更新的处理方式。
技能链接
https://github.com/github/awesome-copilot/blob/main/skills/dependabot/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“帮我配置 Dependabot,让它每周更新一次我的 Node.js 依赖项。”
每周 5 个新技能,1 分钟读完。
工作原理
你需要在项目根目录下创建一个名为 `dependabot.yml` 的文件来配置 Dependabot。在这个文件里,你可以指定它需要监控哪些类型的代码库(比如 npm、pip、Docker),这些代码库在哪里,以及多久检查一次更新。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Dependabot Configuration & Management
Overview
Dependabot is GitHub's built-in dependency management tool with three core capabilities:
- Dependabot Alerts — Notify when dependencies have known vulnerabilities (CVEs)
- Dependabot Security Updates — Auto-create PRs to fix vulnerable dependencies
- Dependabot Version Updates — Auto-create PRs to keep dependencies current
All configuration lives in a single file: .github/dependabot.yml on the default branch. GitHub does not support multiple dependabot.yml files per repository.
Configuration Workflow
Follow this process when creating or optimizing a dependabot.yml:
Step 1: Detect All Ecosystems
Scan the repository for dependency manifests. Look for:
| Ecosystem | YAML Value | Manifest Files |
|---|---|---|
| npm/pnpm/yarn | npm |
package.json, package-lock.json, pnpm-lock.yaml, yarn.lock |
| pip/pipenv/poetry | pip |
requirements.txt, Pipfile, pyproject.toml, setup.py |
| uv | uv |
pyproject.toml, uv.lock |
| Docker | docker |
Dockerfile |
| Docker Compose | docker-compose |
docker-compose.yml |
| GitHub Actions | github-actions |
.github/workflows/*.yml |
| Go modules | gomod |
go.mod |
| Bundler (Ruby) | bundler |
Gemfile |
| Cargo (Rust) | cargo |
Cargo.toml |
| Composer (PHP) | composer |
composer.json |
| NuGet (.NET) | nuget |
*.csproj, packages.config |
| .NET SDK | dotnet-sdk |
global.json |
| Maven (Java) | maven |
pom.xml |
| Gradle (Java) | gradle |
build.gradle |
| Terraform | terraform |
*.tf |
| OpenTofu | opentofu |
*.tf |
| Helm | helm |
Chart.yaml |
| Hex (Elixir) | mix |
mix.exs |
| Swift | swift |
Package.swift |
| Pub (Dart) | pub |
pubspec.yaml |
| Bun | bun |
bun.lockb |
| Dev Containers | devcontainers |
devcontainer.json |
| Git Submodules | gitsubmodule |
.gitmodules |
| Pre-commit | pre-commit |
.pre-commit-config.yaml |
Notes:
- pnpm and yarn both use the
npmecosystem value. - Prefer
uvecosystem value whenuv.lockis present; otherwise usepip.
Step 2: Map Directory Locations
For each ecosystem, identify where manifests live. Use directories (plural) with glob patterns for monorepos:
directories:
- "/" # root
- "/apps/*" # all app subdirs
- "/packages/*" # all package subdirs
- "/lib-*" # dirs starting with lib-
- "**/*" # recursive (all subdirs)
Important: directory (singular) does NOT support globs. Use directories (plural) for wildcards.
Step 3: Configure Each Ecosystem Entry
Every entry needs at minimum:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
Step 4: Optimize with Grouping, Labels, and Scheduling
See sections below for each optimization technique.
Monorepo Strategies
Glob Patterns for Workspace Coverage
For monorepos with many packages, use glob patterns to avoid listing each directory:
- package-ecosystem: "npm"
directories:
- "/"
- "/apps/*"
- "/packages/*"
- "/services/*"
schedule:
interval: "weekly"
Cross-Directory Grouping
Use group-by: dependency-name to create a single PR when the same dependency updates across multiple directories:
groups:
monorepo-deps:
group-by: dependency-name
This creates one PR per dependency across all specified directories, reducing CI costs and review burden.
Limitations:
- All directories must use the same package ecosystem
- Applies to version updates only
- Incompatible version constraints create separate PRs
Standalone Packages Outside Workspaces
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.
Dependency Grouping
Reduce PR noise by grouping related dependencies into single PRs.
By Dependency Type
groups:
dev-dependencies:
dependency-type: "development"
update-types: ["minor", "patch"]
production-dependencies:
dependency-type: "production"
update-types: ["minor", "patch"]
By Name Pattern
groups:
angular:
patterns: ["@angular*"]
update-types: ["minor", "patch"]
testing:
patterns: ["jest*", "@testing-library*", "ts-jest"]
For Security Updates
groups:
security-patches:
applies-to: security-updates
patterns: ["*"]
…
常见问题
什么是“Dependabot Alerts”?
这是当 Dependabot 发现你正在使用的某个代码库存在已知安全漏洞时,发送给你的提醒通知。
什么是“Dependabot Security Updates”?
这是 Dependabot 自动创建的更新,用来修复代码库中已发现的安全漏洞。
什么是“Dependabot Version Updates”?
这是 Dependabot 自动创建的更新,即使没有安全问题,也能让你的代码库保持在最新版本。
详情
作者的原始描述
Comprehensive guide for configuring and managing GitHub Dependabot. Use this skill when users ask about creating or optimizing dependabot.yml files, managing Dependabot pull requests, configuring dependency update strategies, setting up grouped updates, monorepo patterns, multi-ecosystem groups, security update configuration, auto-triage rules, or any GitHub Advanced Security (GHAS) supply chain s
repo: github/awesome-copilot
热度
- GitHub 星标
- 40k
- 排名
- #7170
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
acquire-codebase-knowledge
40k帮你的智能体理解并编写现有代码项目的文档。它有助于新成员快速上手,或者快速了解项目架构。
acreadiness-assess
40k让你的智能体评估一个项目对 AI 的准备程度,并生成报告。它有助于了解项目在使用 AI 工具方面的准备情况。
acreadiness-generate-instructions
40k帮你的智能体根据评估结果编写 AI 工具的指令文件。它有助于改善 AI 与代码的交互方式,并弥补已发现的不足。
acreadiness-policy
40k让你的智能体协助制定或应用 AI 项目评估的政策。它有助于规范项目的评估方式,并确保合规。