Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions skills/git-workflow/evals/evals.json
Original file line number Diff line number Diff line change
Expand Up @@ -1434,5 +1434,30 @@
"The Depends-on sentence and optional green check safely enforce the dependency."
]
}
},
{
"name": "watch-exit-zero-on-finished-check-only",
"prompt": "Right after a force-push I ran `gh pr checks 12 --watch`. It exited 0 at once and printed one line: `review-dependabot-pr skipping`. The previous head had 28 checks. Is the PR green?",
"assertions": [
{
"type": "content",
"pattern": "(watched nothing|not (yet )?registered)"
},
{
"type": "content",
"pattern": "(28|fewer|count)"
},
{
"type": "content",
"pattern": "(re-?arm|wait)"
}
],
"samples": {
"passing": "No. The watch exited on a check that had already finished, so it watched nothing. Only 1 of the previous 28 checks is listed, so the main workflow has not registered yet. Wait until a read shows a pending check, then re-arm the watch.",
"failing": [
"Yes, the watch exited 0 with no failures, so the PR is green.",
"Yes, the PR is green. There are no pending checks; the count is 1 of 28. Do not re-arm the watch."
]
}
}
]
24 changes: 21 additions & 3 deletions skills/git-workflow/references/merge-gate-watcher.md
Original file line number Diff line number Diff line change
Expand Up @@ -466,14 +466,32 @@ Two consequences for the loop:

- Read the watcher's output, not only its exit code. A run that ends on the
"no checks reported" line watched nothing and has to be re-armed.
- Give the runs a moment to appear, or arm the watcher on a read that has
already seen at least one check. A plain `gh pr checks <n>` right after the
push shows whether anything is `pending` yet; arm `--watch` once it does.
- Give the runs a moment to appear, and arm the watcher only on a read that
shows at least one check `pending`. A plain `gh pr checks <n>` right after the
push shows whether anything is `pending` yet; arm `--watch` once it does. A
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
check that has already finished does not count: a `pull_request_target`
workflow that skips itself, such as a Dependabot reviewer, reports seconds
after the push, and `--watch` exits 0 on it while the main workflow has not
registered yet.
- A read that shows no `pending` check is complete only when the workflows of
the current head are all there. Check that with
`gh run list --commit <head-sha>` against the workflows the previous head ran,
then read `pr-status.sh`. Keep waiting while only self-skipping checks are
listed.
- Compare the number of checks with the previous head's run. Far fewer checks
than last time is a warning that the rest have not registered yet. It is not
proof: a change to a workflow or its matrix can change the count, so settle it
with the run list above.

Seen 2026-09-18 on a rebase-and-force-push: the watcher returned immediately,
`gh pr checks` a moment later listed seven checks all `pending`, and the
re-armed watcher then reported them green.

Seen 2026-11-21 on phpDocumentor/guides#1448 after a force-push: the first
read listed one check, a skipped `review-dependabot-pr`, and `--watch` exited 0
at once. The `Integrate` workflow registered 75 seconds after the push; the
previous head had 28 checks.

## Auto-merge armed + CLEAN but never enqueued: disable/re-enable to nudge

On a merge-queue repo a PR can sit `CLEAN` with auto-merge **armed** and every required check green, yet never gets a `mergeQueueEntry` — it silently fails to enter the queue, so the watcher just times out. Confirm the symptom, then re-arm to force GitHub to re-evaluate enqueue-readiness:
Expand Down
Loading