Skip to content

ci: automate version bumps via changesets (Version-PR + auto-merge)#197

Merged
Lykhoyda merged 1 commit into
mainfrom
ci/changesets-release-automation
May 31, 2026
Merged

ci: automate version bumps via changesets (Version-PR + auto-merge)#197
Lykhoyda merged 1 commit into
mainfrom
ci/changesets-release-automation

Conversation

@Lykhoyda

Copy link
Copy Markdown
Owner

What

Adds .github/workflows/release.yml — the changesets/action Version-PR pattern with auto-merge.

Flow

  1. Feature PRs carry a changeset (already enforced by the require-changeset CI gate).
  2. On push to main, this workflow opens/updates a "Version Packages" PR that runs npm run version-packages (accumulating all pending changesets).
  3. Auto-merge is enabled on that PR, so it lands without a manual click → versions bump on main → the new version is installable from the marketplace.

No npm publish step: the plugin's "package" is the manifest the marketplace reads from the repo, so only the version half of changesets/action is used.

Security note

The gh pr merge step passes the PR number through an env: variable (PR_NUMBER) rather than interpolating ${{ steps.changesets.outputs.pullRequestNumber }} directly into the shell command — eliminating the injection surface even though the value is numeric and action-controlled.

Required repo settings (enable before this works)

  • Settings → Actions → General → "Allow GitHub Actions to create and approve pull requests"
  • Settings → General → "Allow auto-merge"
  • Branch protection on main with ≥1 required status check — gh pr merge --auto needs a check to gate on; with none, auto-merge has nothing to wait for.

Notes

  • Why a Version PR (not a direct push to main): it keeps the bump reviewable/visible and avoids racing concurrent merges, while auto-merge keeps it hands-off.
  • The Version PR changes only version files + CHANGELOG + changeset deletions (no src), so require-changeset passes on it.

🤖 Generated with Claude Code

…erge)

On push to main, opens a "Version Packages" PR that runs version-packages
and auto-merges it, so merged changesets become an installable version bump
without a manual step. No npm publish (marketplace reads the repo manifest).

Also tightens the auto-merge step: PR_NUMBER is passed through an env var
rather than interpolated directly into the shell command, eliminating any
theoretical injection surface.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Lykhoyda Lykhoyda merged commit 1d682af into main May 31, 2026
9 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