merge-dependabot-prs
Skill21 starsChanged 11 days agoMITView on GitHub
Walk the open Dependabot PR queue oldest-first and merge each one once CI is green. Use when the user asks to "merge dependabot PRs", "clear the dependabot queue", "process bot updates", "ship the dep bumps", or similar. Fixes failing CI when possible (pushing to the bot's branch or opening a follow-up PR), and never blocks the queue on a single failure — skips and continues.
- Installs packages
- Commits and pushes
4 other projects use a version of this.
Adopted by
Most recently taken up by
- Addono/skillstheir own version, first seen Oct 13, 2026
- onyx-dot-app/onyx-fosstheir own version, first seen Oct 8, 2026
- onyx-dot-app/onyxtheir own version, first seen Oct 8, 2026
- hussainweb/skillstheir own version, first seen Sep 18, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- onyx-dot-app/onyx★ 33ksame name
- onyx-dot-app/onyx-foss★ 320same name
- hussainweb/skills★ 3same name
- Addono/skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository11 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .claude/CLAUDE.mdCLAUDE.md
- eval-benchSkill
- handoffSkill
- live-hypervisorSkill
- live-kernelSkill
- release-rust-crates-ioSkill
- review-roundSkill
- tiersSkill
- msrc-patch-diffSkill
- windbg-debuggingSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. 0 are common, 6 are distinctive, and 8 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 36
MCP: call mcp__github__list_pull_requests with state: "open".
- Distinctive: line 38
If the list is empty, report so and stop.
- Very specific: line 53
If mergeStateStatus is BEHIND or DIRTY, ask Dependabot to rebase rather than rebasing yourself — it handles its own lockfile regen:
- Very specific: line 58
Wait ~60–120s, re-read state.
- Very specific: line 67
If checks never start, comment @dependabot recreate and re-poll.
- Very specific: line 71
Check repo merge settings once at start of run (gh repo view --json mergeCommitAllowed,squashMergeAllowed,rebaseMergeAllowed).
- Distinctive: line 108
If push is rejected (branch protection, or the actor lacks write to bot branches), fall through to Path 2.
- Distinctive: line 112
Create a new branch off the Dependabot branch:
- Distinctive: line 125
After push, loop back to step 2c (wait for CI on the new commit).
- Distinctive: line 129
If at any point this PR can't be merged and you've attempted one fix cycle, stop trying, log the reason, move to the next PR.
- Distinctive: line 133
When the queue is exhausted, print:
- Very specific: line 141
@dependabot rebaseis async: After commenting, the bot takes 30s–2min to push. - Very specific: line 142
Closing a Dependabot PR tells the bot "don't try again.": If you close one that needs to come back, comment @dependabot recreate — not just …
- Very specific: line 147
CI required checks vs. all checks: Only required checks block merge.
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Merge Dependabot PRs
Process the open Dependabot PR queue oldest first. For each PR: bring it up to date with the base, wait for CI, merge if green. If CI fails, attempt an automated fix (push to the bot's branch if writable, otherwise open a follow-up PR). A single failing PR never stops the run — log the reason and move on.
0. Detect GitHub tooling (once, up front)
if command -v gh >/dev/null 2>&1 && gh auth status >/dev/null 2>&1; then
echo "USE: gh"
else
echo "USE: mcp"
fighavailable → usegheverywhere below.- Otherwise (Claude Code on the web, restricted environments) → use the
mcp__github__*tools. Each step shows both.
Confirm the target repo (gh repo view / current git remote -v). If the user wants a different repo than cwd, ask.
1. List Dependabot PRs, oldest first
gh:
gh pr list \
--author 'app/dependabot' \
--state open \
--json number,title,createdAt,headRefName,baseRefName,mergeable,mergeStateStatus \
--jq 'sort_by(.createdAt)'MCP: call mcp__github__list_pull_requests with state: "open". Filter results where user.login == "dependabot[bot]". Sort ascending by created_at.
If the list is empty, report so and stop.
Capture the ordered list of PR numbers — process them in that order, one at a time.
2. Inner loop: process one PR
For the current PR #N:
2a. Read state
- gh:
gh pr view N --json number,title,headRefName,baseRefName,mergeable,mergeStateStatus,statusCheckRollup,reviewDecision - MCP:
mcp__github__pull_request_read(method: "get") + (method: "status") for checks.
2b. Rebase if behind / dirty
If mergeStateStatus is BEHIND or DIRTY, ask Dependabot to rebase rather than rebasing yourself — it handles its own lockfile regen:
- gh:
gh pr comment N --body "@dependabot rebase" - MCP:
mcp__github__add_issue_commentwith that body.
Wait ~60–120s, re-read state. If the bot doesn't act after two attempts, fall through to manual rebase (git fetch && git rebase origin/<base>) on the branch, or comment @dependabot recreate.
2c. Wait for CI
Poll statusCheckRollup until no check is IN_PROGRESS / PENDING / QUEUED. Cap at ~10 min per PR.
- gh:
gh pr checks N --watch(blocks until done) or loop ongh pr view N --json statusCheckRollup. - MCP: loop on
mcp__github__pull_request_readwithmethod: "status", sleep 15–30s between polls.
If checks never start, comment @dependabot recreate and re-poll.
2d. If green → merge
Check repo merge settings once at start of run (gh repo view --json mergeCommitAllowed,squashMergeAllowed,rebaseMergeAllowed). Prefer squash for Dependabot PRs when allowed (clean history: one bump = one commit).
- gh:
gh pr merge N --squash --delete-branch - MCP:
mcp__github__merge_pull_requestwith the allowedmerge_method.
Go back to step 2 for the next PR in the queue.
2e. If red → diagnose
- Pull failing logs.
- gh:
gh pr checks N→gh run view <run-id> --log-failed - MCP: read
statusCheckRollupfor each check'sdetailsUrl;WebFetchthe run page or usemcp__github__get_commitfor the SHA's checks.
- gh:
Classify (in order — stop at first match):
Failure type Action Flake / infra hiccup (network, runner crash) Re-run the failed job, don't push code. gh run rerun <run-id> --failedLockfile / generated-file drift Run the project's regen command (e.g. npm install,bundle install,cargo update -p X,pnpm install --lockfile-only), commit, push.Snapshot / fixture mismatch Regenerate ( jest -u,vitest --update, etc.), eyeball the diff for sanity, commit, push.Real code change (API rename, removed export, breaking type) Write the codemod / fix. Run tests locally if possible. Commit, push. Major-version bump with breaking changes you can't safely fix here Skip. Comment a brief note on the PR explaining what's needed, move on. Repeated failure after one fix attempt Skip. Don't loop forever.
2f. Push the fix — branch path first, follow-up PR fallback
Path 1 — push to the Dependabot branch:
git fetch origin <headRefName>
git checkout <headRefName>
# apply fix
git add -A
git commit -m "fix: <what>"
git push origin <headRefName>If push is rejected (branch protection, or the actor lacks write to bot branches), fall through to Path 2.
Path 2 — follow-up PR:
- Create a new branch off the Dependabot branch:
git fetch origin <headRefName> git checkout -b followup/<N>-fix origin/<headRefName> # apply fix git commit -m "fix: <what> (carries #N)" git push -u origin followup/<N>-fix - Open a PR targeting the same base as
#N:- gh:
gh pr create --base <baseRefName> --title "..." --body "Carries #N forward with required fixes." - MCP:
mcp__github__create_pull_requestwith the same fields.
- gh:
- Treat the follow-up PR as the new current PR in the loop. When it merges, the original Dependabot PR will auto-close (because its commits are now in base) — or close it explicitly with a note pointing at the follow-up.
After push, loop back to step 2c (wait for CI on the new commit).
2g. Never block the queue
If at any point this PR can't be merged and you've attempted one fix cycle, stop trying, log the reason, move to the next PR. Don't let one stuck bump strand the rest.
3. Final report
When the queue is exhausted, print:
- Merged:
#12, #15, #18, … - Skipped:
#14 — major-version React bump; render snapshots need human review,#17 — repeated lint failure after two fix cycles - Open follow-ups:
#22 (carries #16)
Gotchas
@dependabot rebaseis async. After commenting, the bot takes 30s–2min to push. Don't trust the immediate post-comment state read; poll.- Closing a Dependabot PR tells the bot "don't try again." If you close one that needs to come back, comment
@dependabot recreate— not just reopen. - Branch protection re-checks on every merge. A PR that was green an hour ago may show
BLOCKEDafter an earlier merge in this same run (now behind). Always re-read state at step 2a, even if you already saw it green. - Grouped updates (
dependabot.ymlgroups:): one PR may contain many bumps. If only one dep in the group breaks tests, consider@dependabot ignore <name>+ recreate rather than fighting the failing test. - Don't use
@dependabot merge. It bypasses any fixes you've pushed and gives you no record of which PRs this run touched. Do the merges yourself. - Secondary rate limits on long runs (30+ PRs). Back off 30s on any 403/429 from the API.
- CI required checks vs. all checks. Only required checks block merge. An optional check failing is not a reason to skip — verify
mergeable: MERGEABLErather than reading "any check red = bad." needs.*in workflows can leave a job permanently pending if a dependency was skipped. If a check is stuckQUEUEDfor >5min with no runner activity, it's probably aneedsgraph issue, not a slow runner — comment@dependabot recreateto get fresh check runs.
Inputs the user might give
- "merge them all" → run the full procedure on every open Dependabot PR.
- "just the patch bumps" → after listing, filter PR titles for
^Bump .* from X.Y.Z to X.Y.(Z+n)(no major/minor change) before looping. - "dry run" → run steps 1, 2a, 2c (status only). Don't merge. Print what would happen.
- "just #N" → skip step 1, jump into step 2 for that one PR.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

