mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-12 20:15:40 +00:00
ci(release): use PAT_TOKEN for semantic-release branch protection bypass
semantic-release needs to push version bump + CHANGELOG commits directly to main. GITHUB_TOKEN cannot bypass branch protection rules, causing @semantic-release/git to fail with "push declined due to repository rule violations". PAT_TOKEN has admin bypass and resolves the issue.
This commit is contained in:
1 parent
d7d9eb0891
commit
343c36f97d
1 file changed
+7
-6
@@ -20,8 +20,9 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
# Always use the built-in workflow token; PAT rotation/breakage must not block releases.
|
# PAT_TOKEN required: semantic-release pushes version bump commits to main,
|
||||||
token: ${{ github.token }}
|
# which needs branch protection bypass. github.token cannot push to protected branches.
|
||||||
|
token: ${{ secrets.PAT_TOKEN }}
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
@@ -49,10 +50,10 @@ jobs:
|
|||||||
id: release
|
id: release
|
||||||
env:
|
env:
|
||||||
HUSKY: 0
|
HUSKY: 0
|
||||||
# Use built-in GITHUB_TOKEN for release + issue operations.
|
# PAT_TOKEN bypasses branch protection so semantic-release can push
|
||||||
# Checkout credentials are resolved above with PAT fallback.
|
# version bump + CHANGELOG commits directly to main
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.PAT_TOKEN }}
|
||||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
Reference in new issue
Block a user