ci: release without pushing back to main - #7
Merged
Conversation
Protecting main means required status checks reject any direct push to it, including the release commit and including one made with a PAT, so @semantic-release/git and @semantic-release/changelog cannot work here. The GitHub Release notes become the changelog. Pi resolves a git-installed package by commit SHA and never reads its package.json version, so the in-repo bump was buying nothing.
|
🎉 This PR is included in version 1.1.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
Prerequisite for protecting
main.Why
A required status check rejects any direct push to the protected branch,
including the
chore(release):commit semantic-release makes — and including oneauthenticated with a PAT:
semantic-release's own maintainers are explicit that it "cannot perform any magic
to bypass those rules on its own"
(discussion #2450).
So the release commit has to go, or protection can't.
Losing it costs nothing here: pi resolves a git-installed package by commit SHA
(
gitHasAvailableUpdateincore/package-manager.js), and only ever readspackage.json.versionfor npm sources. The version bump was invisible to everyconsumer of this package.
What
@semantic-release/gitand@semantic-release/changelog(config + devDeps).CHANGELOG.md— nothing would update it, and a stale changelog is worsethan none. GitHub Release notes are the changelog.
main(pi hard-resets theclone to
origin/maineach update), they are not pinned. Only@vX.Y.Zpins.The old wording claimed all refs were pins.
Tags and Releases are unaffected by branch protection, so the pipeline is otherwise
unchanged.
Verification
npm run checkpasses.npx semantic-release --dry-runloads and verifies thetrimmed plugin chain with no git/changelog steps.
Follow-up (not in this PR)
Protect
main: requirecheck (node 20)+check (node 24), require a PR,strict: true, no force-push, no deletion.