Skip to content

Commit 0a7e3bd

Browse files
committed
tech: add release token to prerelease pipeline
1 parent e8a0a77 commit 0a7e3bd

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

.github/workflows/prerelease.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
uses: actions/checkout@v4
2828
with:
2929
fetch-depth: 0
30-
token: ${{ secrets.GITHUB_TOKEN }}
30+
token: ${{ secrets.RELEASE_TOKEN }}
3131

3232
- name: Setup Go
3333
uses: actions/setup-go@v5
@@ -38,7 +38,7 @@ jobs:
3838

3939
- name: Configure Git
4040
env:
41-
TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
TOKEN: ${{ secrets.RELEASE_TOKEN }}
4242
run: |
4343
git config --global advice.detachedHead false
4444
git config --global url."https://${TOKEN}:x-oauth-basic@github.com/".insteadOf "https://github.com/"
@@ -64,6 +64,7 @@ jobs:
6464
if: steps.changes.outputs.HAS_CHANGES == 'true'
6565
env:
6666
IS_MINOR: ${{ contains(inputs.release-as-minor, 'true') }}
67+
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
6768
run: |
6869
CURRENT_VERSION_PARTS=(${CURRENT_VERSION//./ })
6970
MAJOR=${CURRENT_VERSION_PARTS[0]}
@@ -87,6 +88,8 @@ jobs:
8788
8889
- name: Release New Version
8990
if: ${{ success() && github.ref_name == 'master' && steps.changes.outputs.HAS_CHANGES == 'true' && !inputs.skip-release }}
91+
env:
92+
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
9093
run: |
9194
git tag -a ${NEW_VERSION} -m "New version ${NEW_VERSION}"
9295
echo "Pushing new tag to remote, which will trigger the Release workflow"

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ jobs:
4141
args: release --clean
4242
env:
4343
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
44-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}

0 commit comments

Comments
 (0)