Repository navigation
ci: release the commit that set __version__ and pin the release actions - #250
Merged
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.
Submit a pull request
CLA
Description of the pull request
Follow-up to #249. The release job trusted an existing
v<version>tag and otherwise built$GITHUB_SHA. Tags are unprotected, so anyone with write access could pushv4.34.2at an unreviewed commit while the release PR is open, and the merge would build and publish that commit through Trusted Publishing. Without a tag, a failed or replaced release run let a later push publish the version from a commit with changes outside the release PR.checknow builds the commit that set__version__instream_chat/__pkg__.py, found withgit log -Sover the full history it already fetches. A rerun or a later push publishes the reviewed release PR and nothing merged after it.__version__fails the run instead of releasingv.ncipollo/release-actionruns withcontents: writeand could otherwise create tags at any commit, and the build job's actions produce the files thatpublishuploads.How to verify: the merge of this PR runs
checkwithrelease=false(4.34.1 is on PyPI) and skips the rest. Locally, the step returns thev4.34.1tag commit for 4.34.1, builds the bump commit when a later commit sits on top, and fails when the tag points elsewhere.Note
Medium Risk
Changes how PyPI/GitHub releases are chosen and adds tag/version invariants; mis-detection or a bad
git log -Smatch could block or mis-ship releases, but scope is limited to CI.Overview
The release check job no longer releases whatever commit is tagged or the workflow’s
GITHUB_SHA. When a version isn’t on PyPI yet, it resolvesrefto the commit that introduced that__version__instream_chat/__pkg__.pyviagit log -S, and fails the run if an existingv*tag points elsewhere or if__version__is empty.All release workflow actions that were on floating majors are pinned to full commit SHAs (checkout, github-script, setup-python, ncipollo/release-action), reducing supply-chain drift for jobs that can tag or ship artifacts.
Reviewed by Cursor Bugbot for commit 23d5176. Bugbot is set up for automated code reviews on this repo. Configure here.