Skip to content

fix(ci): drop the auto-merge job's own check by run id, not workflow name - #7

Open
singlerider wants to merge 1 commit into
mainfrom
fix/automerge-self-filter
Open

singlerider wants to merge 1 commit into
mainfrom
fix/automerge-self-filter

Conversation

@singlerider

Copy link
Copy Markdown
Contributor

What

dependabot-auto-merge.yml filters its own check out of the wait loop by GITHUB_RUN_ID matched against each check's link, instead of .workflow != github.workflow.

Why

GitHub names a workflow entity from the default branch. bbot's caller lives only on dev, so its check reports workflow as .github/workflows/dependabot-auto-merge.yml while github.workflow is Dependabot auto-merge. The self-filter never matched, the job saw itself pending, and every dependabot run sat until timeout-minutes: 180 and was cancelled. In a called workflow GITHUB_RUN_ID is the caller's run id, which is what the check link carries, so this survives renames and callers missing from the default branch.

Validation

Real checks from blacklanternsecurity/bbot#3490, where run 37648243807 is the stuck auto-merge job:

$ gh pr checks 3490 -R blacklanternsecurity/bbot --json name,bucket,link,workflow > checks.json
before (name filter): 18 of 18
after (run id filter): 17
remaining buckets: pass,skipping

The old filter kept its own pending check; the new one drops exactly that check and would proceed to merge. Callers need their pin moved to the merge commit to pick this up.

Closes #6

…name

The wait loop filtered its own check out with `.workflow != github.workflow`.
GitHub names a workflow entity from the default branch, so a caller that
lives only on `dev` (bbot) is registered under its file path while
`github.workflow` is the `name:` key. The filter never matched, the job saw
itself pending, and every dependabot run sat until the 180 minute timeout.

Filter on `GITHUB_RUN_ID` against each check's link instead. In a called
workflow that is the caller's run id, which is what the check link carries,
so it survives renames and callers missing from the default branch.

Closes #6
@singlerider singlerider self-assigned this Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dependabot-auto-merge: self-filter compares workflow names, so the job waits on its own check

1 participant