SuperAPI AI 工具集

dependabot

部署与运维

查看项目

更新于 10-16 08:46

技能介绍

用途:Dependabot 是 GitHub 内置的依赖管理工具,具备三项能力:Dependabot Alerts(依赖存在已知漏洞时告警)、Dependabot Security Updates(自动创建 PR 修复存在漏洞的依赖)、Dependabot Version Updates(自动创建 PR 保持依赖为最新)。全部配置集中在默认分支的单个文件 .github/dependabot.yml,GitHub 不支持每个仓库多个该文件。

主要能力与用法:配置流程为先扫描仓库中的依赖清单以识别生态(如 npm、pip、uv、docker、github-actions、gomod、bundler、cargo、composer、nuget、maven、gradle、terraform、helm 等,pnpm 与 yarn 均使用 npm,存在 uv.lock 时优先用 uv),再用 directories 配合 glob 模式映射目录(单数 directory 不支持通配符),随后为每个生态条目至少设置 package-ecosystem、directory、schedule。支持依赖分组(按类型、名称模式、安全更新,多组匹配时归入首个匹配组,未分组依赖单独提 PR)、跨目录分组 group-by: dependency-name、多生态分组 multi-ecosystem-groups(需搭配 patterns)、PR 定制(labels、commit-message、assignees、milestone、分支名分隔符、target-branch)、schedule(daily/weekly/monthly/quarterly/semiannually/yearly/cron 及 day、time、timezone)、cooldown 冷却期、版本策略(auto/increase/increase-if-necessary/lockfile-only/widen)、rebase 策略、open-pull-requests-limit、私有注册表 registries,以及 ignore/allow/exclude-paths 规则(同时匹配 allow 与 ignore 时以 ignore 为准)。安全更新在仓库设置中启用;分组安全更新可在 YAML 的 groups 中以 applies-to: security-updates 配置;open-pull-requests-limit: 0 可关闭版本更新 PR;自动分类规则在仓库设置的 Advanced Security 中配置。PR 可用 @dependabot 注释命令交互(rebase、recreate、ignore 各类版本、分组内 unignore 等);自 2026 年 1 月起 merge/close/reopen 命令已弃用,改用 GitHub 原生 UI、CLI(gh pr merge)或自动合并。

限制与注意:每个仓库仅一个 dependabot.yml;cooldown 与 target-branch 等配置仅作用于版本更新,安全更新仍指向默认分支;跨目录分组要求目录使用同一生态且仅适用版本更新,版本约束不兼容时会拆分 PR。

预提交扫描:可在 AI 编码代理中使用 GitHub MCP Server 的 dependabot 工具集对照 GitHub Advisory Database 检查新增依赖并返回受影响包、严重级别与建议修复版本,也可在本地运行 Dependabot CLI 对比改动前后的依赖图。安装 Advanced Security 插件可获得依赖扫描工具与 /dependency-scanning 技能。启用方式示例:copilot --add-github-mcp-toolset dependabot;在 copilot 内 /plugin install advanced-security@copilot-plugins;VS Code 中为 GitHub MCP Server 头添加 "X-MCP-Toolsets": "dependabot" 或在 Copilot Chat 工具集选择器中选择 Dependabot。该依赖扫描功能于 2026 年 5 月公开预览。

补充:资料未提供 Dependabot 的收费与价格信息,暂未提供。