File tree Expand file tree Collapse file tree 1 file changed +15
-8
lines changed Expand file tree Collapse file tree 1 file changed +15
-8
lines changed Original file line number Diff line number Diff line change 13
13
id-token : write
14
14
contents : write
15
15
steps :
16
+ - uses : actions/create-github-app-token@v2
17
+ id : app-token
18
+ with :
19
+ # required
20
+ app-id : ${{ secrets.APP_ID }}
21
+ private-key : ${{ secrets.PRIVATE_KEY }}
22
+ - name : Get GitHub App User ID
23
+ id : get-user-id
24
+ run : echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
25
+ env :
26
+ GH_TOKEN : ${{ steps.app-token.outputs.token }}
27
+ - run : |
28
+ git config --global user.name '${{ steps.app-token.outputs.app-slug }}[bot]'
29
+ git config --global user.email '${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com'
16
30
- name : Checkout code
17
31
uses : actions/checkout@v5
18
32
- uses : pnpm/action-setup@v4
@@ -22,21 +36,14 @@ jobs:
22
36
cache : ' pnpm'
23
37
- name : Install dependencies
24
38
run : pnpm install
25
- - name : Set publishing config
26
- run : pnpm config set '//registry.npmjs.org/:_authToken' "${NODE_AUTH_TOKEN}"
27
- env :
28
- NODE_AUTH_TOKEN : ${{secrets.NPM_TOKEN}}
29
39
- name : Tag and Release
30
40
run : |
31
- git config --global user.email "[email protected] "
32
- git config --global user.name "GitHub Action"
33
41
pnpm ci:version
34
42
git add .
35
43
git commit -m "chore(release): publish"
36
44
pnpm ci:tag
37
45
pnpm ci:publish
38
46
git push && git push --tags
39
47
env :
40
- GITHUB_TOKEN : ${{secrets.GITHUB_TOKEN}}
41
- NPM_TOKEN : ${{secrets.NPM_TOKEN}}
48
+ GITHUB_TOKEN : ${{ steps.app-token.outputs.token }}
42
49
NPM_CONFIG_PROVENANCE : true
You can’t perform that action at this time.
0 commit comments