| name | dependabot-review |
| description | User-invoked only. Merge green minor/patch bumps, diagnose failing ones, escalate majors |
| disable-model-invocation | true |
Review and action open Dependabot PRs
Fetch all open Dependabot PRs for this repo, check their build status, and approve + merge the green ones. Diagnose and action the failing ones.
Step 1 — List open Dependabot PRs
gh pr list --author "app/dependabot" --state open --json number,title,url,headRefName,createdAt,labels --limit 50
If there are no open Dependabot PRs, output: "✅ No open Dependabot PRs." and stop.
Step 2 — For each PR, fetch build status
gh pr checks <number> --json name,state,conclusion,link
Classify each PR as:
- Green — all checks passed
- Failing — one or more checks failed
- Pending — checks still running
- No checks — no CI configured for this PR (treat as Failing — do not merge)
Step 3 — Action Green PRs
For each Green PR:
- Review the PR title to understand what is being updated (package name, version bump, major/minor/patch).
- Check if it is a major version bump (breaking change risk):
- If major → print a warning and ask: "PR # is a major bump ( → ). Approve and merge anyway?"
- Wait for confirmation before proceeding.
- If minor or patch → proceed automatically.
- Approve the PR:
gh pr review <number> --approve --body "Dependabot auto-approval: all checks green, patch/minor bump."
- Merge the PR using squash merge:
gh pr merge <number> --squash --delete-branch
- Confirm merge succeeded.
Step 4 — Action Failing PRs
For each Failing PR:
-
Identify which checks failed:
gh pr checks <number>
-
Fetch the failed job logs via the gh CLI (see fix-cicd in .agents/skills/fix-cicd/SKILL.md for the drill-down pattern — use the run ID from the checks output). Read the logs and identify the root cause.
-
Categorise the failure:
- Dependency conflict — the new version conflicts with another package
- Type error — the new version changed a type signature
- Test failure — a test broke due to changed behaviour
- Lint failure — new version introduced a linting issue
- Flake / transient — looks like a non-deterministic failure
- Unknown
-
For Flake failures → re-trigger the checks:
gh pr comment <number> --body "@dependabot rebase"
-
For fixable failures (conflict, type error, test, lint):
-
For Unknown failures → leave a diagnostic comment and flag to the user.
Step 5 — Pending PRs
For PRs where checks are still running, note them and skip. They will be picked up next time this command runs.
Step 6 — Final report
Print a summary table:
| PR | Package | Bump | Status | Action taken |
|----|---------|------|--------|--------------|
And a one-line summary: "Merged X, diagnosed Y, skipped Z (pending)."