99permissions :
1010 contents : write
1111 packages : write
12- id-token : write
1312
1413jobs :
1514 settings :
@@ -18,35 +17,34 @@ jobs:
1817 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
1918 outputs :
2019 release_tag : ${{ steps.prerelease.outputs.tagName }}
20+ app_token : ${{ steps.app-token.outputs.token }}
2121 steps :
2222 - uses : actions/checkout@v6
2323 - id : prerelease
2424 run : |
2525 gh release list --limit 1 --json tagName --jq \
2626 '.[]|to_entries|map("\(.key)=\(.value|tostring)")|.[]' >> $GITHUB_OUTPUT
2727 - run : gh release edit ${{ steps.prerelease.outputs.tagName }} --latest --prerelease=false
28+ - id : app-token
29+ uses : actions/create-github-app-token@v2
30+ with :
31+ app-id : ${{ secrets.APP_ID }}
32+ private-key : ${{ secrets.GH_APP_PRIVATE_KEY }}
2833
2934 commit :
3035 name : Publish Brew and Scoop
3136 needs :
3237 - settings
3338 runs-on : ubuntu-latest
3439 steps :
35- # use GitHub app to create a release token that can publish to homebrew-tap and scoop
36- - name : Generate token
37- id : app-token
38- uses : actions/create-github-app-token@v2
39- with :
40- app-id : ${{ secrets.APP_ID }}
41- private-key : ${{ secrets.GH_APP_PRIVATE_KEY }}
4240 - uses : actions/checkout@v6
4341 - uses : actions/setup-go@v6
4442 with :
4543 go-version-file : go.mod
4644 cache : true
4745 - run : go run tools/publish/main.go ${{ needs.settings.outputs.release_tag }}
4846 env :
49- GITHUB_TOKEN : ${{ steps.app-token .outputs.token }}
47+ GITHUB_TOKEN : ${{ needs.settings .outputs.app_token }}
5048
5149 publish :
5250 name : Publish NPM
@@ -59,44 +57,35 @@ jobs:
5957
6058 compose :
6159 name : Bump self-hosted versions
60+ needs :
61+ - settings
6262 runs-on : ubuntu-latest
6363 steps :
64- - name : Generate token
65- id : app-token
66- uses : actions/create-github-app-token@v2
67- with :
68- app-id : ${{ secrets.APP_ID }}
69- private-key : ${{ secrets.GH_APP_PRIVATE_KEY }}
7064 - uses : actions/checkout@v6
7165 - uses : actions/setup-go@v6
7266 with :
7367 go-version-file : go.mod
7468 cache : true
7569 - run : go run tools/selfhost/main.go
7670 env :
77- GITHUB_TOKEN : ${{ steps.app-token .outputs.token }}
71+ GITHUB_TOKEN : ${{ needs.settings .outputs.app_token }}
7872
7973 changelog :
8074 name : Publish changelog
8175 needs :
76+ - settings
8277 - commit
8378 - publish
8479 runs-on : ubuntu-latest
8580 steps :
86- - name : Generate token
87- id : app-token
88- uses : actions/create-github-app-token@v2
89- with :
90- app-id : ${{ secrets.APP_ID }}
91- private-key : ${{ secrets.GH_APP_PRIVATE_KEY }}
9281 - uses : actions/checkout@v6
9382 - uses : actions/setup-go@v6
9483 with :
9584 go-version-file : go.mod
9685 cache : true
9786 - run : go run tools/changelog/main.go ${{ secrets.SLACK_CHANNEL }}
9887 env :
99- GITHUB_TOKEN : ${{ steps.app-token .outputs.token }}
88+ GITHUB_TOKEN : ${{ needs.settings .outputs.app_token }}
10089 SLACK_TOKEN : ${{ secrets.SLACK_TOKEN }}
10190
10291 docs :
@@ -105,17 +94,11 @@ jobs:
10594 - settings
10695 runs-on : ubuntu-latest
10796 steps :
108- - name : Generate token
109- id : app-token
110- uses : actions/create-github-app-token@v2
111- with :
112- app-id : ${{ secrets.APP_ID }}
113- private-key : ${{ secrets.GH_APP_PRIVATE_KEY }}
11497 - uses : actions/checkout@v6
11598 - uses : actions/setup-go@v6
11699 with :
117100 go-version-file : go.mod
118101 cache : true
119102 - run : go run docs/main.go ${{ needs.settings.outputs.release_tag }} | go run tools/bumpdoc/main.go apps/docs/spec/cli_v1_commands.yaml
120103 env :
121- GITHUB_TOKEN : ${{ steps.app-token .outputs.token }}
104+ GITHUB_TOKEN : ${{ needs.settings .outputs.app_token }}
0 commit comments