Skip to content

Commit

Permalink
tech: add release token to prerelease pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
sylviamoss committed Feb 17, 2024
1 parent e8a0a77 commit 0a7e3bd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.RELEASE_TOKEN }}

- name: Setup Go
uses: actions/setup-go@v5
Expand All @@ -38,7 +38,7 @@ jobs:

- name: Configure Git
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
TOKEN: ${{ secrets.RELEASE_TOKEN }}
run: |
git config --global advice.detachedHead false
git config --global url."https://${TOKEN}:x-oauth-basic@github.com/".insteadOf "https://github.com/"
Expand All @@ -64,6 +64,7 @@ jobs:
if: steps.changes.outputs.HAS_CHANGES == 'true'
env:
IS_MINOR: ${{ contains(inputs.release-as-minor, 'true') }}
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
run: |
CURRENT_VERSION_PARTS=(${CURRENT_VERSION//./ })
MAJOR=${CURRENT_VERSION_PARTS[0]}
Expand All @@ -87,6 +88,8 @@ jobs:
- name: Release New Version
if: ${{ success() && github.ref_name == 'master' && steps.changes.outputs.HAS_CHANGES == 'true' && !inputs.skip-release }}
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
run: |
git tag -a ${NEW_VERSION} -m "New version ${NEW_VERSION}"
echo "Pushing new tag to remote, which will trigger the Release workflow"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ jobs:
args: release --clean
env:
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}

0 comments on commit 0a7e3bd

Please sign in to comment.