Repository navigation
ci: refuse to publish commits that are not on the release branch - #28
Merged
Merged
Conversation
Add a first step to the publish job that uses the compare API to check that the commit being released is already contained in `main`. A release or tag pointing at a commit that never landed there now fails before anything is checked out, built or published, regardless of environment approval.
Move the check out of the publishing job(s) into a verify job they need. A bad commit is now rejected before the environment approval is requested and before any job receives publishing secrets or tokens, and verify only gets contents: read.
Gemini review: passReviewed This PR adds a verification job to the npm publish workflow to ensure that commits triggered by releases or tags are ancestors of the main branch before proceeding to the publish job. No malicious patterns or critical security issues were found, though the conditional check skips verification for non-tag/non-release triggers.
Automated check. High/critical findings block merging; a human approval is still required. False positive? Ask devops to bypass. |
Cafe137
approved these changes
Nov 17, 2026
This branch was successfully deployed
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.
Adds a first step to the publish workflow that checks, via the compare API, that the commit being released is already on
main. A release or tag pointing at a commit that never landed there now fails before checkout, build or publish, even if the deployment is approved.Non-tag runs are unaffected: the step only runs for release events
or tag refs.