Skip to content

fix(ci): land lockstep wrapper bumps via PR-merge instead of direct push#94

Merged
vivek7405 merged 1 commit into
mainfrom
chore/lockstep-via-pr-flow
May 24, 2026
Merged

fix(ci): land lockstep wrapper bumps via PR-merge instead of direct push#94
vivek7405 merged 1 commit into
mainfrom
chore/lockstep-via-pr-flow

Conversation

@vivek7405
Copy link
Copy Markdown
Collaborator

Summary

Permanent fix for the Auto-release workflow's "Lockstep-bump wrappers"
step, which was rejected by main branch protection on the 0.8.6
release. Also bumps create-webjs + webjsdev in source so they
match the already-published @webjsdev/cli@0.8.6.

Why the obvious fix doesn't work

The natural fix would be to add github-actions to
required_pull_request_reviews.bypass_pull_request_allowances.apps.
That doesn't work:

  • The github-actions[bot] runtime identity isn't a real installable
    GitHub App; it's a built-in pseudo-actor. The branch-protection API
    silently drops it from the apps array (I tried), and the UI picker
    for bypass actors doesn't surface it. Confirmed by both API
    inspection and a manual UI search.
  • The remaining bypass routes (PAT belonging to an admin, custom
    GitHub App with bypass entitlement, org-level rulesets) all need
    more infrastructure than the problem warrants.

What this PR does

.github/workflows/release.yml the lockstep step now goes through
the PR machinery instead of a direct push:

  1. Bumps wrapper package.json files (unchanged).
  2. Creates auto/lockstep-<version>-<run-id>, commits, pushes the branch.
    (Branch protection only applies to main; pushing to a feature
    branch is fine.)
  3. Opens a PR via gh pr create with title prefixed
    chore(release): so it's filtered out by backfill-changelog.js
    (the rendered /changelog stays clean).
  4. Immediately squash-merges via gh pr merge --squash --delete-branch.
    Branch protection accepts merges through PRs, which is what
    this satisfies. No bypass entitlement needed.
  5. Publishes wrappers to npm (unchanged, still idempotent).

Adds pull-requests: write to the workflow's permissions: block
and sets GH_TOKEN on the lockstep step so gh calls work.

packages/create-webjs/package.json + packages/webjsdev/package.json
bumps version 0.8.50.8.6 and @webjsdev/cli dep ^0.8.5
^0.8.6. Mirrors what the bot would have committed if its push had
succeeded.

After merge

The release workflow won't re-fire (no changelog/** change in this
PR), so the wrappers need one last manual publish to catch up:

git switch main && git pull
npm publish --workspace=create-webjs --access=public
npm publish --workspace=webjsdev --access=public

Verify with npm view create-webjs version and npm view webjsdev version
(both should print 0.8.6).

From the next release onward, the workflow self-heals.

Test plan

  • npm test via pre-commit hook (1151/1151 pass).
  • Manual reasoning on the script's branch + merge dance (see
    inline comments in the workflow file).
  • After merge + manual publish, npm create webjs@latest demo
    from a clean cache boots cleanly.
  • Next real release: confirm the auto-opened lockstep PR is
    squash-merged automatically and wrappers publish.

Companion cleanup

PR #93 will be closed after this lands; its content is superseded
by the wrapper bumps included here.

The Auto-release workflow's "Lockstep-bump wrappers" step has been
direct-pushing to main as github-actions[bot]. Branch protection
rejected the push on the 0.8.6 release:

  remote: error: GH006: Protected branch update failed for refs/heads/main.
  remote: - Changes must be made through a pull request.

The natural fix (add `github-actions` to `bypass_pull_request_allowances`)
doesn't work: the built-in runtime identity isn't a real installable
GitHub App, so the API silently drops it and the UI picker doesn't
surface it. Granting bypass would require either a custom GitHub App
or a PAT belonging to a human admin, both bigger lifts than the
problem warrants.

Restructure the step to push to a temp branch + open a PR + immediately
squash-merge it. Branch protection accepts merges through PRs, no
bypass needed. The auto-opened PRs use `chore(release):` prefix so
`scripts/backfill-changelog.js` filters them out, keeping the rendered
/changelog clean.

Also lockstep-bumps create-webjs + webjsdev to 0.8.6 in source so
they match the already-published @webjsdev/cli@0.8.6 (and the npm
publishes can be done manually one last time after this lands; future
releases self-heal via the new flow).
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