Auto-create GitHub Release on tag push#6
Merged
Conversation
Tag-push currently uploads to PyPI but does not create a GitHub Release entry — the Releases page on github.com/mstorath/CSSD stays out of sync with PyPI. This step closes that gap by extracting the matching `## <version>` section from CHANGELOG.md (bracket-tolerant, accepts `## [1.0.1]` and `## 1.0.1`) and posting it to GitHub Releases via softprops/action-gh-release@v2, with all wheels and the sdist attached as assets. Implementation: - Job-level `permissions` block added (replaces top-level inherit). Keeps `id-token: write` for OIDC; adds `contents: write` for the release step. - `actions/checkout@v4` added so CHANGELOG.md is on disk. - An awk extractor; falls back to a tag-commits link if no matching heading or no CHANGELOG.md. - `generate_release_notes: true` appends an auto-generated PR/commit summary on top of the changelog body. - Idempotent: updates an existing Release for the tag rather than erroring, so manual pre-creation never blocks a re-run. See devcontainer reports/12-auto-github-release-pattern.md for the shared pattern and the rationale.
This was referenced May 8, 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.
Summary
Pushing a
v*tag publishes to PyPI but does not create an entry on the GitHub Releases page. This PR closes that gap: thepublishjob inrelease.ymlnow also creates a GitHub Release, with the matching## <version>section ofCHANGELOG.mdas the body and all wheels + sdist attached as assets.Identical pattern to:
How it works
In the existing
publishjob, after the PyPI upload:actions/checkout@v4putsCHANGELOG.mdon disk.## <ver>section verbatim — bracket-tolerant so it accepts both## [1.0.1] - dateand## 1.0.1 — date. Falls back to a tag-commits link if nothing matches.softprops/action-gh-release@v2creates the Release with that as the body, attachesdist/*, and stacksgenerate_release_notes: trueon top for an auto-generated PR/commit summary.Job-level
permissionsblock added (replaces top-level inherit):id-token: writefor OIDC +contents: writefor the release action.Idempotent: updates in place if a Release for the tag already exists.
Test plan
CHANGELOG.mdlocally — the## [1.0.1]heading matches.v*tag push.