Skip to content

ci: open the Version Packages PR with a PAT so its required checks run - #1262

Merged
tenphi merged 1 commit into
mainfrom
fix-version-pr-required-checks
Jul 29, 2026
Merged

ci: open the Version Packages PR with a PAT so its required checks run#1262
tenphi merged 1 commit into
mainfrom
fix-version-pr-required-checks

Conversation

@tenphi

@tenphi tenphi commented Jul 29, 2026

Copy link
Copy Markdown
Member

Describe changes

Release PRs in this repo can only be merged with an admin override. This fixes the cause.

What's happening

main's protection requires four checks:

Build & canary release · Tests & lint · UI Tests · UI Review

All four originate from pull-request.yml, which triggers on pull_request only.

The changesets action in publish.yml was passed the default GITHUB_TOKEN. GitHub deliberately does not fire pull_request events for PRs opened with that token — it's an anti-recursion rule, so Actions can't trigger Actions indefinitely. The result is that a Version Packages PR collects only the external checks that don't depend on workflow events:

Version Packages PR normal PR
Cursor Bugbot, Vercel, Vercel Preview Comments, snyk
Build & canary release ❌ never runs
Tests & lint ❌ never runs
UI Tests ❌ never runs
UI Review ❌ never runs

So it sits at mergeStateStatus: BLOCKED forever. Confirmed on the currently-open #1259 and on the already-merged #1256, which shows the same four external checks and nothing else — meaning every release so far has been merged by overriding protection.

Fix

Point the action at the existing UIKIT_GITHUB_TOKEN PAT, so the PR is opened as a user and receives the normal PR workflows. One line, plus a comment recording why it must not be reverted to GITHUB_TOKEN.

The Comment PR step (line 99) intentionally keeps the default token — it only posts a canary comment and needs no elevated identity.

Why not the alternatives

  • Adding a push trigger for changeset-release/** would also emit the four context names without any credential, but it relies on Chromatic posting UI Tests / UI Review statuses on a branch build rather than a PR build — less certain, and it makes the release PR behave unlike every other PR.
  • Removing the required checks from protection would weaken main for every PR to solve a bot-PR problem.

Follow-up needed after merge

The already-open #1259 was created by the old token, so it will not retroactively gain checks. To clear it: close #1259 and delete its changeset-release/main branch — the next Publish run on main recreates it with the PAT, and it should then go green and merge without an override. I can do that once this lands.

Two things I can't verify from here, worth a glance:

  1. UIKIT_GITHUB_TOKEN must be unexpired with repo + workflow scope. It was added 2024-06-13 and is currently referenced by no workflow, so I could not test it. If the next release PR is opened by github-actions[bot] rather than a user, the token is the reason.
  2. A PAT-opened PR is attributed to that token's owner, so release PRs will show as authored by you rather than the Actions bot.
Checklist
  • Pipeline is passed
  • Tests are added — n/a, CI configuration only
  • Tests are passed successfully
  • If you're adding a new component/new props, add stories — n/a
  • Changeset(s) is(are) added — none: no shipped code changes, so nothing to version
  • Commit message follows commit guidelines

Closes: N/A

Other information

No published output changes — this touches only how the release PR is opened.

🤖 Generated with Claude Code


Note

Low Risk
CI credential swap only; no runtime or package code changes, though release PR auth now depends on PAT validity and scopes.

Overview
Fixes release PRs stuck behind branch protection by having the changesets action authenticate with secrets.UIKIT_GITHUB_TOKEN instead of the default GITHUB_TOKEN when creating or updating the Version Packages PR.

GitHub does not emit pull_request workflows for PRs opened by GITHUB_TOKEN, so those release PRs never ran the four checks main requires (Build & canary release, Tests & lint, UI Tests, UI Review) and could only merge via admin override. A PAT opens the PR as a normal user PR so existing pull-request.yml jobs run.

Adds an inline comment in publish.yml documenting why this must stay a PAT. The canary Comment PR step is unchanged and still uses GITHUB_TOKEN.

Reviewed by Cursor Bugbot for commit aba9414. Bugbot is set up for automated code reviews on this repo. Configure here.

`main` requires four checks — Build & canary release, Tests & lint, UI Tests
and UI Review — all produced by pull-request.yml, which triggers only on
`pull_request`. The changesets action was passed the default GITHUB_TOKEN, and
GitHub deliberately does not fire `pull_request` events for PRs opened with
that token (anti-recursion). So the Version Packages PR only ever collected the
external checks (Bugbot, Vercel, snyk) and never the four required ones,
leaving it permanently BLOCKED and mergeable only via admin override.

Point the action at the existing UIKIT_GITHUB_TOKEN PAT so the PR is opened as
a user and gets the normal PR workflows.

The `Comment PR` step keeps the default GITHUB_TOKEN — it only posts a canary
comment and needs no elevated identity.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cube-ui-kit Ready Ready Preview, Comment Jul 29, 2026 12:56pm

Request Review

@changeset-bot

changeset-bot Bot commented Jul 29, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: aba9414

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.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

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

@github-actions

Copy link
Copy Markdown
Contributor

📦 NPM canary release

Deployed canary version 0.0.0-canary-4ff5228.

@github-actions

Copy link
Copy Markdown
Contributor

🧪 Storybook is successfully deployed!

@github-actions

Copy link
Copy Markdown
Contributor

🏋️ Size limit report

Name Size Passed?
All 434.03 KB (0% 🟰) Yes 🎉
Tree shaking (just a Button) 114.87 KB (0% 🟰) Yes 🎉

Click here if you want to find out what is changed in this build

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit aba9414. Configure here.

commit: 'chore: release'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Must be a PAT, not the default GITHUB_TOKEN. GitHub deliberately

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incomplete PAT for release PR

Medium Severity

The PAT is only passed to changesets/action, while actions/checkout still persists the default GITHUB_TOKEN in git extraheader. That header wins over later credentials, so Version Packages branch pushes stay attributed to the Actions bot. GitHub then suppresses pull_request synchronize runs, so required checks still fail to re-run when the release PR is updated and it can remain blocked.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit aba9414. Configure here.

@tenphi
tenphi merged commit 006c083 into main Jul 29, 2026
16 checks passed
@tenphi
tenphi deleted the fix-version-pr-required-checks branch July 29, 2026 13:00
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