ci: automate version bumping on merge to main#96
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a GitHub Action that bumps the package version automatically, once, on
main, after a PR is merged — so we stop bumping by hand in every feature PR.Why
Manual per-PR bumping has two problems:
1.2.3), because neither branch knows about the other.Bumping at merge time, on
main, removes the manual step and makes collisions impossible (bumps are serialized onmain).How it works
main.minorormajorlabel to the PR before merging.npm versionupdatespackage.json+package-lock.json, commits (chore: bump version to X [skip ci]), and creates a git tag.[skip ci]prevents a re-trigger loop, and a title guard skips the bot's own bump commit.Contributor impact: none. No commit-message conventions required (unlike release-please / semantic-release). Just write code; the version takes care of itself.
main: if direct pushes are restricted, either allowgithub-actions[bot]to bypass, or switch the push to use a PAT. Without that the action will fail to push.1.2.4bump from before this existed — fine to keep for that one.)Test plan
chore: bump version to 1.2.xcommit + tag tomain, and does not loop.minorand confirm a minor bump.