fix: make release workflow compatible with immutable releases - #949
Merged
Conversation
farhan
marked this pull request as draft
September 1, 2026 14:54
The org has immutable releases enabled, which freezes a release's assets
the moment it is published. The old flow let python-semantic-release
publish the GitHub Release and then attached the built distributions
afterwards via publish-action, which now fails with HTTP 422 ("cannot
upload assets to an immutable release"). That failure aborts the release
job before publish_to_pypi runs, so the tag is created but never shipped
to PyPI (v6.3.2 is tagged but missing from PyPI).
Set vcs_release: "false" so python-semantic-release commits, tags, and
builds but does not publish the release, then create it with
`gh release create` which uploads the assets to a draft and publishes it
atomically -- the ordering immutable releases require. All actions are
SHA-pinned to match the sample-plugin standard.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
farhan
force-pushed
the
farhan/fix-immutable-release
branch
from
September 1, 2026 15:05
1779f02 to
c7b8e1a
Compare
farhan
marked this pull request as ready for review
September 1, 2026 15:09
irfanuddinahmad
approved these changes
Sep 1, 2026
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.
Important
PR implemented with the assistance of Claude Code. Refined and validated before being submitted for code review.
Problem
This org has immutable releases enabled, which freezes a release's assets the moment it is published. The current
release.ymlletspython-semantic-releasepublish the GitHub Release first, then attaches the built distributions afterwards viapython-semantic-release/publish-action. That afterward-attach is no longer allowed and fails with:The failing step aborts the
releasejob beforepublish_to_pypiruns, so the tag and GitHub Release are created but the package is never shipped to PyPI.This has already happened:
v6.3.2is tagged (2026-08-10, run 31368659412) with an empty assets list, and PyPI is still at6.3.1. Every futurefix:/feat:release fails the same way until this is fixed.Fix
Adopt the immutable-safe draft-then-publish pattern from the
sample-pluginstandard:vcs_release: "false"on thepython-semantic-releasestep so it commits, tags, pushes, and builds the distributions but does not create the GitHub Release itself.gh release create "$TAG" ... dist/*, which creates it as a draft, uploads the assets, and only then publishes it — the only ordering immutable releases permit.python-semantic-release/publish-actionstep.upload-artifact,download-artifact,python-semantic-release,gh-action-pypi-publish) to match the standard.PyPI publishing is unchanged — still OIDC trusted publishing via
pypa/gh-action-pypi-publishwithid-token: write.Result
Once merged, this
fix:commit produces a fresh release that finally lands on PyPI, validating the corrected pipeline and closing the6.3.1 → 6.3.2publishing gap.Testing Notes
Validated with
actionlint(passes) and an SHA-pin audit (all third-party actions pinned). The release path itself can only be exercised on merge tomaster.🤖 Generated with Claude Code