chore: create a GitHub Release on every tagged publish#7
Conversation
📝 WalkthroughWalkthroughThe ChangesAutomated GitHub Release on publish
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/publish.yml:
- Around line 92-95: The race condition exists because another concurrent run
can create the release between the if check and the gh release create command.
Fix this by making the gh release create command itself tolerant to concurrent
creation instead of relying on the check. Modify the gh release create "$tag"
--verify-tag --generate-notes command to either suppress errors when the release
already exists or add conditional logic that continues silently if the release
is already present by the time the create command executes, eliminating the time
gap where concurrent runs can interfere.
- Line 64: The publish workflow job grants `contents: write` permission but uses
mutable action references. Replace the three action refs (actions/checkout@v6,
actions/setup-python@v6, and pypa/gh-action-pypi-publish@release/v1) with their
full 40-character commit SHAs to prevent security risks if these actions are
compromised. Look up the current commit SHA for each action version and pin each
action reference to its corresponding SHA format.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: c84674b1-9748-4645-ae93-e86375bb4d09
📒 Files selected for processing (2)
.github/workflows/publish.ymlRELEASING.md
Make a GitHub Release part of the default release flow instead of a manual, forgettable step. After a successful PyPI publish, the workflow creates a Release for the tag with notes auto-generated from the merged PRs since the previous tag (idempotent: skips if the release already exists). Grant the publish job contents: write for this, and document it in RELEASING.md.
18fd29d to
a637f18
Compare
Summary
publish.ymlcreates a Release for the tag with notes auto-generated from the merged PRs since the previous tag.publishjobcontents: write(needed to create the release); it already hadid-token: writefor OIDC.# vX.Y.Zcomments) in bothpublish.ymlandci.yml, since the publish job now carries write scope. Dependabot manages the bumps.RELEASING.md.Backwards compatibility
CI/release workflow only. No package or API change.
Test plan
publish.ymlandci.ymlparse as valid YAML;check-yamlclean@vN/@release/refs)