Skip to content

ci: release the commit that set __version__ and pin the release actions - #250

Merged
mogita merged 1 commit into
masterfrom
ci/release-version-commit
Nov 18, 2026
Merged

mogita merged 1 commit into
masterfrom
ci/release-version-commit

Conversation

@mogita

@mogita mogita commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Submit a pull request

CLA

  • I have signed the Stream CLA (required).
  • The code changes follow best practices
  • Code changes are tested (add some information if not applicable)

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 push v4.34.2 at 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.

  • check now builds the commit that set __version__ in stream_chat/__pkg__.py, found with git log -S over the full history it already fetches. A rerun or a later push publishes the reviewed release PR and nothing merged after it.
  • An existing tag for the version must point at that commit, or the run fails.
  • An empty __version__ fails the run instead of releasing v.
  • Every action is pinned to a commit, on the same major as before. ncipollo/release-action runs with contents: write and could otherwise create tags at any commit, and the build job's actions produce the files that publish uploads.

How to verify: the merge of this PR runs check with release=false (4.34.1 is on PyPI) and skips the rest. Locally, the step returns the v4.34.1 tag 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 -S match 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 resolves ref to the commit that introduced that __version__ in stream_chat/__pkg__.py via git log -S, and fails the run if an existing v* 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.

@mogita
mogita merged commit d3e8bd9 into master Nov 18, 2026
11 checks passed
@mogita
mogita deleted the ci/release-version-commit branch November 18, 2026 15:24
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