From 0309a9ab047bef7b3535e558f86e40f3c89470a1 Mon Sep 17 00:00:00 2001 From: Shane Engelman Date: Wed, 7 Oct 2026 14:50:56 -0700 Subject: [PATCH] fix(ci): drop the auto-merge job's own check by run id, not workflow 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 --- .github/workflows/dependabot-auto-merge.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml index 73256f1..d9c4f6a 100644 --- a/.github/workflows/dependabot-auto-merge.yml +++ b/.github/workflows/dependabot-auto-merge.yml @@ -21,13 +21,13 @@ jobs: env: PR_URL: ${{ github.event.pull_request.html_url }} HEAD: ${{ github.event.pull_request.head.sha }} - SELF: ${{ github.workflow }} GH_TOKEN: ${{ github.token }} run: | - others='[.[] | select(.workflow != env.SELF)]' + # Workflow names diverge when the caller isn't on the default branch, run ids don't. + others='[.[] | select((.link // "") | contains("/actions/runs/" + env.GITHUB_RUN_ID + "/") | not)]' while :; do sleep 30 - checks=$(gh pr checks "$PR_URL" --json name,bucket,workflow --jq "$others") || true + checks=$(gh pr checks "$PR_URL" --json name,bucket,link --jq "$others") || true [ "$(jq length <<<"$checks")" -gt 0 ] || continue jq -e 'any(.bucket == "pending")' <<<"$checks" >/dev/null && continue break