Skip to content

ci(changesets): auto-open Version Packages PR on staging push - #366

Merged
codewizdave merged 1 commit into
stagingfrom
feat/changeset-version
Aug 3, 2026
Merged

ci(changesets): auto-open Version Packages PR on staging push#366
codewizdave merged 1 commit into
stagingfrom
feat/changeset-version

Conversation

@martyy-code

Copy link
Copy Markdown
Contributor

Summary

Adds .github/workflows/changeset-version.yml to automate the "Version Packages" PR step from docs/engineering/plans/release-pipeline.md §6.3.

When code is pushed to staging, this workflow opens or updates a PR titled "chore: version packages" from branch changesets/version to main. The PR contains the result of pnpm changeset version: bumped versions, generated CHANGELOG entries, and consumed changeset files.

Merging that PR into main triggers release.yml, which publishes to npm via Trusted Publishing.

Why

Before this PR, version bumps had to be done manually:

git checkout staging
pnpm changeset version
git push origin staging

That was the only path documented in §11 of the plan that wasn't yet implemented. This PR closes that gap.

Changes

  • New file: .github/workflows/changeset-version.yml
  • Trigger: push to staging.
  • Calls changesets/action@v1.9.0 (SHA pinned at a45c4d594aa4e2c509dc14a9f2b3b67ba3780d0d).
  • The publish input on the action is deliberately not set. Publishing is the job of release.yml (with its anti-republish guard, smoke test, and SHA-pinned actions). Setting publish here would cause a double-publish.

Hardening

  • All third-party actions pinned by commit SHA (consistent with the rest of the pipeline).
  • Permissions: contents: write, pull-requests: write.
  • No environment, no id-token — this workflow does not touch the npm registry.
  • concurrency group with cancel-in-progress: a new push to staging cancels the previous attempt.

Test plan

  • pnpm turbo type-check passes.
  • pnpm turbo lint passes.
  • First push to staging after merge: workflow opens a "Version Packages" PR (empty if no changesets, populated if changesets are present).
  • Merge the resulting "Version Packages" PR: release.yml triggers a publish via Trusted Publishing.

Risk

Low. The workflow only writes to a non-default branch (changesets/version) and opens PRs. No publish path, no secrets required beyond the default GITHUB_TOKEN.

Rollback

Delete the workflow file and remove the remote branch if needed. The changesets/version branch (if any) can be deleted from the GitHub UI.

🤖 Generated with Claude Code

Adds .github/workflows/changeset-version.yml implementing the
'Version Packages PR' step from docs/engineering/plans/release-pipeline.md §6.3.

Behavior:
- Triggered on push to staging.
- Runs changesets/action@v1.9.0 (SHA pinned) to open or update
  a PR titled 'chore: version packages' from branch
  'changesets/version' to main.
- The PR contains the result of 'pnpm changeset version':
  bumped package versions, generated CHANGELOG entries,
  consumed changeset files.
- Merging the PR into main triggers release.yml, which
  publishes to npm via Trusted Publishing.

Important: the 'publish' input is intentionally NOT set on the
changesets/action. Publishing is the job of release.yml (with
its anti-republish guard, smoke test, and SHA-pinned actions).
Setting 'publish' here would cause a double-publish.

Permissions:
- contents: write (to push the version branch)
- pull-requests: write (to open/update the Version Packages PR)

Hardening:
- All third-party actions pinned by commit SHA:
  - actions/checkout        3d3c42e5 (v7.0.1)
  - pnpm/action-setup       0ebf4713 (v6.0.9)
  - actions/setup-node      82076278 (v7.0.0)
  - changesets/action       a45c4d59 (v1.9.0)
- No environment required (this workflow does not publish or
  touch the npm registry).
- concurrency group with cancel-in-progress on staging push
  (a new push cancels the previous attempt).
@codewizdave
codewizdave merged commit fdc9997 into staging Aug 3, 2026
5 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.

2 participants