@@ -10,14 +10,31 @@ jobs:
1010 timeout-minutes : 30
1111 runs-on : ubuntu-latest
1212 steps :
13+ - name : Generate GitHub App token
14+ id : app-token
15+ uses : actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3
16+ with :
17+ app-id : ${{ secrets.CQ_APP_ID }}
18+ private-key : ${{ secrets.CQ_APP_PRIVATE_KEY }}
19+ permission-contents : write
20+ permission-pull-requests : write
21+ - name : Generate GitHub App token for cloud repo
22+ id : app-token-cloud
23+ uses : actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3
24+ with :
25+ app-id : ${{ secrets.CQ_APP_ID }}
26+ private-key : ${{ secrets.CQ_APP_PRIVATE_KEY }}
27+ repositories : |
28+ cloud
29+ permission-contents : read
1330 - name : Checkout
1431 uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
1532 with :
16- token : ${{ secrets.GH_CQ_BOT }}
33+ token : ${{ steps.app-token.outputs.token }}
1734
1835 - name : Get Specs File
1936 run : |
20- curl -H "Authorization: token ${{ secrets.GH_CQ_BOT }}" https://raw.githubusercontent.com/cloudquery/cloud/main/cloud/internal/servergen/spec.json -o spec.json
37+ curl -H "Authorization: token ${{ steps.app-token-cloud.outputs.token }}" https://raw.githubusercontent.com/cloudquery/cloud/main/cloud/internal/servergen/spec.json -o spec.json
2138
2239 - name : Format Specs File
2340 run : |
@@ -38,11 +55,10 @@ jobs:
3855 uses : peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8
3956 with :
4057 # required so the PR triggers workflow runs
41- token : ${{ secrets.GH_CQ_BOT }}
58+ token : ${{ steps.app-token.outputs.token }}
4259 branch : fix/gen-cloudquery-api
4360 base : main
4461 title : ' fix: Generate CloudQuery Go API Client from `spec.json`'
4562 commit-message : ' fix: Generate CloudQuery Go API Client from `spec.json`'
4663 body : This PR was created by a scheduled workflow to generate the CloudQuery Go API Client from `spec.json`
47- author : cq-bot <cq-bot@users.noreply.github.com>
4864 labels : automerge
0 commit comments