Skip to content

fix(release): approve the Version Packages PR's parked runs instead of dispatching CI - #66

Merged
unional merged 1 commit into
mainfrom
fix/approve-version-pr-runs
Oct 11, 2026
Merged

unional merged 1 commit into
mainfrom
fix/approve-version-pr-runs

Conversation

@unional

@unional unional commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

Why

changesets/action opens the "version packages" PR with GITHUB_TOKEN, so its author is github-actions[bot]. GitHub creates the PR's pull_request runs (CI and CodeQL) but parks them with conclusion action_required until someone approves them. The workflow_dispatch of CI added earlier satisfies the code / all-checks rule but never produces the CodeQL code_scanning result, so the PR stays BLOCKED.

What

The "Start CI on the version packages PR" step is replaced by "Approve the version packages PR's pending runs":

  • It runs on the same condition as before: a PR was created or updated and nothing was published.
  • It reads the head SHA of changeset-release/<ref_name> and lists that branch's runs at that SHA whose conclusion is action_required or whose status is waiting/action_required. It polls for up to about 60s while GitHub creates them, then lists once more to catch workflows created later.
  • It approves each one with POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve.
  • It is fail-soft. Any error becomes a ::warning:: that names the cause, and a 403 points at the caller's actions: write grant.
  • The ci-workflow input and the dispatch are gone. Callers' workflow_dispatch: on their CI workflow is now unnecessary but harmless. The headers say so.

Verification

  • I checked GITHUB_TOKEN against the approve endpoint in a throwaway repo, where a workflow opened a PR with GITHUB_TOKEN:
    • With actions: write, the parked runs were approved (201 Created) and went from action_required to success. This covered two workflows on a changeset-release/… branch, so slashes in the branch name work.
    • With actions: read, the approve call returned 403 Resource not accessible by integration. The step printed the actions: write warning and the job still passed.
  • actionlint adds no new findings on the changed files. Any findings it reports are from older actions/*@v3 pins that this PR does not touch.
  • I searched the org's code for callers passing with: ci-workflow: and found none.

🤖 Generated with Claude Code

…f dispatching CI

GitHub parks the version PR's pull_request runs (CI, CodeQL) as
action_required because github-actions[bot] opened it. Dispatching CI
satisfied the all-checks rule but never produced the CodeQL result, so
the PR stayed blocked. Approve the parked runs with GITHUB_TOKEN
(actions: write) instead, fail-soft, and drop the ci-workflow input.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: unional <homawong@gmail.com>
@changeset-bot

changeset-bot Bot commented Oct 11, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 0b4d714

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@mergify

mergify Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again.

@unional
unional merged commit b3956a9 into main Oct 11, 2026
3 checks passed
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.

1 participant