Skip to content

ci: stop waiting on the approval-gated pull_request run - #31

Merged
siarheidudko merged 2 commits into
mainfrom
claude/stuck-prs-dependency-update-18rrre
Aug 8, 2026
Merged

ci: stop waiting on the approval-gated pull_request run#31
siarheidudko merged 2 commits into
mainfrom
claude/stuck-prs-dependency-update-18rrre

Conversation

@siarheidudko

Copy link
Copy Markdown
Member

Rolls out the fix from siarheidudko/claude#5.

Problem

Autoupdate PRs that pass their checks still never merge. The autoupdate job hangs on Wait for PR checks and merge until its 60-minute timeout, so gh pr merge is never reached.

For a bot-authored PR, GitHub queues a pull_request run of the check workflows that is gated on manual approval and stays in action_required forever, while the runs autoupdate dispatches explicitly go green. gh pr checks --watch reads the status rollup, which includes the gated run, so it waits on a check that can never complete.

This is the same approval gate behind the earlier "PRs have no checks at all" symptom (fixed in #29). That fix made the checks run; the gated run still exists and now poisons the wait instead.

Changes

autoupdate.yml — poll commits/{sha}/check-runs instead of gh pr checks --watch. Gated runs produce no check runs, so this sees only jobs that actually execute. The loop is bounded at 20 minutes, and merging now requires at least one check, none pending, and none concluded outside success/neutral/skipped — the old condition merged unless grep found fail in human-readable output, which also passes with zero checks and misses cancelled/timed_out.

Generated from the siarheidudko/claude templates; no repo-specific hand edits. release.yml is untouched.


Generated by Claude Code

claude added 2 commits August 7, 2026 23:21
Autoupdate PRs that passed their checks still never merged. The job hung
on "Wait for PR checks and merge" until its 60-minute timeout, so
`gh pr merge` was never reached.

Cause: for a bot-authored PR, GitHub queues a pull_request run for
pr-checks that is gated on manual approval and stays in `action_required`
indefinitely. That run appears in the status rollup `gh pr checks` reads,
so `--watch` waited on a check that can never complete -- even though the
run this workflow dispatches explicitly had already gone green.

Poll the check-runs API for the PR head instead. Gated runs produce no
check runs, so this view sees only jobs that actually execute. The loop
is bounded at 20 minutes and refuses to merge unless at least one check
exists, none are pending, and none concluded outside
success/neutral/skipped -- previously a `grep` for the word "fail" over
human-readable output.

Note this is a workaround, not the root fix: the approval gate itself is
a repository Actions setting. With it lifted, the pull_request run would
execute normally and the explicit dispatches would become redundant.
Two gaps kept autoupdate PRs piling up every week even after the wait
fix, because the failure path was never finished.

1. Nothing merged it. The success path merges itself, but a PR that
   needed a Claude fix stayed open forever once its checks went green --
   no step anywhere merged it. That is the "PRs keep hanging" symptom in
   its own right, independent of the gated-run problem.

   claude.yml now waits for the checks it dispatched and merges when they
   are green, using the same check-runs poll as autoupdate.yml. If they
   are not green it exits cleanly and leaves the PR open for review.

2. Nothing bumped the version. The autoupdater bumps it on the success
   path only; neither the persist step nor the npm-check-updates fallback
   touches it. So a needs-claude PR merged with the version unchanged,
   release-on-version-bump saw no change, and the dependency update was
   never published. Five packages had to be bumped by hand last cycle.

   autoupdate.yml now bumps the patch version on the failure path, and
   skips if the version already moved.

Note this means Claude's compatibility fixes now merge without review,
matching how the success path already behaves. Drop the merge step if
that is not wanted.

Not changed: the duplicate pr-checks runs. Making the push and
pull_request events share a concurrency group would let the gated run
cancel the dispatched one that the merge gate depends on -- the waste is
tolerable, a cancelled good run is not.
@siarheidudko
siarheidudko marked this pull request as ready for review August 8, 2026 08:14
@siarheidudko
siarheidudko merged commit caa4b8b into main Aug 8, 2026
8 checks passed
@siarheidudko
siarheidudko deleted the claude/stuck-prs-dependency-update-18rrre branch August 8, 2026 08:14
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.

2 participants