Skip to content

Commit a30a647

Browse files
authored
feat(release): add PAT support (#5473)
* chore: add PAT support * chore: set identity earlier
1 parent 8e66b81 commit a30a647

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

.github/workflows/release.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ jobs:
3333
uses: actions/checkout@v4
3434
with:
3535
fetch-depth: 0
36+
token: ${{ secrets.WORKFLOW_PAT }}
37+
persist-credentials: false
3638

3739
- name: Setup Node
3840
uses: actions/setup-node@v4
@@ -53,23 +55,33 @@ jobs:
5355
fi
5456
echo "resolved=$RELEASE_VERSION" >> "$GITHUB_OUTPUT"
5557
56-
- name: Bump versions and commit
58+
- name: Resolve version
5759
env:
5860
INPUT_VERSION: ${{ steps.resolve_version.outputs.resolved }}
5961
run: |
60-
git config user.name "github-actions[bot]"
61-
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
6262
node ./scripts/release/version.js "$INPUT_VERSION"
6363
RESOLVED_VERSION=$(jq -r .version package.json)
64-
git commit -am "chore: release v$RESOLVED_VERSION"
65-
git push origin HEAD
64+
echo "RESOLVED_VERSION=$RESOLVED_VERSION" >> "$GITHUB_ENV"
65+
66+
- name: Set git identity (Actions bot)
67+
run: |
68+
git config user.name "github-actions[bot]"
69+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
70+
71+
- name: Commit & push
72+
uses: actions-js/[email protected]
73+
with:
74+
github_token: ${{ secrets.WORKFLOW_PAT }}
75+
branch: ${{ github.ref_name }}
76+
message: 'chore: release v${{ env.RESOLVED_VERSION }}'
6677

6778
- name: Build
6879
run: yarn build
6980

7081
- name: Tag and create GitHub release
7182
env:
7283
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
84+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7385
run: |
7486
VERSION=$(jq -r .version package.json)
7587
git tag -a "v$VERSION" -m "Release v$VERSION"

0 commit comments

Comments
 (0)