ci(release): use fine-grained PAT for branch protection bypass#183
ci(release): use fine-grained PAT for branch protection bypass#183k-chrispens merged 1 commit intomainfrom
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe release workflow configuration was updated to use a dedicated Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
✨ Finishing Touches🧪 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.
Pull request overview
Updates the automated release workflow to authenticate with a fine-grained Personal Access Token (PAT) so the release automation can bypass branch protection constraints that block the default GITHUB_TOKEN.
Changes:
- Use
secrets.RELEASE_TOKENforactions/checkoutauthentication. - Switch python-semantic-release and publish-action to use
secrets.RELEASE_TOKENinstead ofsecrets.GITHUB_TOKEN.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| with: | ||
| github_token: ${{ secrets.GITHUB_TOKEN }} | ||
| github_token: ${{ secrets.RELEASE_TOKEN }} | ||
| git_committer_name: "github-actions" |
There was a problem hiding this comment.
This workflow now depends on a new RELEASE_TOKEN secret, but there’s no indication in-file of why GITHUB_TOKEN is insufficient or what permissions the PAT must have. Consider adding a short YAML comment near this input documenting the intent (branch-protection bypass) and the minimal fine-grained PAT permissions required so future maintainers can recreate/rotate it without trial-and-error.
| ref: ${{ github.ref_name }} | ||
| fetch-depth: 0 | ||
| fetch-tags: true | ||
| token: ${{ secrets.RELEASE_TOKEN }} |
There was a problem hiding this comment.
actions/checkout persists the provided token into the local git config by default. Since this is now a fine‑grained PAT, it would be safer/clearer to either (a) set persist-credentials: false if subsequent steps don't need git-remote auth, or (b) add an inline note that persisting credentials is intentional (because the workflow needs to push commits/tags) and that RELEASE_TOKEN should be minimally scoped/rotated.
| token: ${{ secrets.RELEASE_TOKEN }} | |
| token: ${{ secrets.RELEASE_TOKEN }} | |
| persist-credentials: false |
Summary by CodeRabbit