-
Notifications
You must be signed in to change notification settings - Fork 4
ci(release): use fine-grained PAT for branch protection bypass #183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,20 +20,21 @@ jobs: | |
| ref: ${{ github.ref_name }} | ||
| fetch-depth: 0 | ||
| fetch-tags: true | ||
| token: ${{ secrets.RELEASE_TOKEN }} | ||
|
|
||
| - run: git reset --hard ${{ github.sha }} | ||
|
|
||
| - name: Semantic Release | ||
| id: release | ||
| uses: python-semantic-release/python-semantic-release@v10.5.3 | ||
| with: | ||
| github_token: ${{ secrets.GITHUB_TOKEN }} | ||
| github_token: ${{ secrets.RELEASE_TOKEN }} | ||
| git_committer_name: "github-actions" | ||
|
Comment on lines
30
to
32
|
||
| git_committer_email: "actions@users.noreply.github.com" | ||
|
|
||
| - name: Publish to GitHub Releases | ||
| if: steps.release.outputs.released == 'true' | ||
| uses: python-semantic-release/publish-action@v10.5.3 | ||
| with: | ||
| github_token: ${{ secrets.GITHUB_TOKEN }} | ||
| github_token: ${{ secrets.RELEASE_TOKEN }} | ||
| tag: ${{ steps.release.outputs.tag }} | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actions/checkoutpersists the providedtokeninto the local git config by default. Since this is now a fine‑grained PAT, it would be safer/clearer to either (a) setpersist-credentials: falseif 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 thatRELEASE_TOKENshould be minimally scoped/rotated.