ci: stop waiting on the approval-gated pull_request run - #31
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 mergeis never reached.For a bot-authored PR, GitHub queues a
pull_requestrun of the check workflows that is gated on manual approval and stays inaction_requiredforever, while the runs autoupdate dispatches explicitly go green.gh pr checks --watchreads 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— pollcommits/{sha}/check-runsinstead ofgh 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 outsidesuccess/neutral/skipped— the old condition merged unlessgrepfoundfailin human-readable output, which also passes with zero checks and missescancelled/timed_out.Generated from the
siarheidudko/claudetemplates; no repo-specific hand edits.release.ymlis untouched.Generated by Claude Code