Skip to content

Commit 86d5ddc

Browse files
committed
chore: use action-js
1 parent 758f0aa commit 86d5ddc

File tree

1 file changed

+7
-22
lines changed

1 file changed

+7
-22
lines changed

.github/workflows/release.yml

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
with:
3434
token: ${{ secrets.WORKFLOW_PAT }}
3535
fetch-depth: 0
36+
persist-credentials: false
3637

3738
- name: Setup Node
3839
uses: actions/setup-node@v4
@@ -61,28 +62,12 @@ jobs:
6162
RESOLVED_VERSION=$(jq -r .version package.json)
6263
echo "RESOLVED_VERSION=$RESOLVED_VERSION" >> "$GITHUB_ENV"
6364
64-
- name: Set git identity (Actions bot)
65-
run: |
66-
git config user.name "github-actions[bot]"
67-
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
68-
- name: Sanity check PAT identity
69-
env:
70-
WORKFLOW_PAT: ${{ secrets.WORKFLOW_PAT }}
71-
run: |
72-
curl -sSf -H "Authorization: Bearer $WORKFLOW_PAT" https://api.github.com/user | jq -r .login
73-
74-
- name: Set remote to use PAT
75-
env:
76-
WORKFLOW_PAT: ${{ secrets.WORKFLOW_PAT }}
77-
run: |
78-
git remote set-url origin "https://x-access-token:${WORKFLOW_PAT}@github.com/${{ github.repository }}.git"
79-
git ls-remote origin 1>/dev/null
80-
81-
- name: Commit and push
82-
run: |
83-
git add -A
84-
git commit -m "chore: release v${RESOLVED_VERSION}"
85-
git push origin "HEAD:${GITHUB_REF_NAME}"
65+
- name: Commit & push with PAT
66+
uses: actions-js/push@v1.4
67+
with:
68+
github_token: ${{ secrets.WORKFLOW_PAT }}
69+
branch: ${{ github.ref_name }}
70+
message: 'chore: release v${{ env.RESOLVED_VERSION }}'
8671

8772
# - name: Bump versions and commit
8873
# env:

0 commit comments

Comments
 (0)