Skip to content

Commit 79bee8d

Browse files
authored
chore(ci): Replace GH_CQ_BOT PAT with GitHub App tokens (#31)
Replace GH_CQ_BOT PAT with short-lived tokens from the cloudquery-ci GitHub App.
1 parent 1ec4d4d commit 79bee8d

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

.github/.kodiak.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
version = 1
33

44
[approve]
5-
auto_approve_usernames = ["cq-bot"]
5+
auto_approve_usernames = ["cloudquery-ci"]
66

77
[merge.message]
88
body = "pull_request_body"

.github/workflows/trigger_gen.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,22 @@ jobs:
99
runs-on: ubuntu-latest
1010
timeout-minutes: 10
1111
steps:
12+
- name: Generate GitHub App token
13+
id: app-token
14+
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3
15+
with:
16+
app-id: ${{ secrets.CQ_APP_ID }}
17+
private-key: ${{ secrets.CQ_APP_PRIVATE_KEY }}
18+
permission-actions: write
19+
repositories: |
20+
plugin-pb-go
21+
plugin-pb-python
22+
plugin-pb-java
23+
plugin-pb-javascript
1224
- name: Trigger plugin-pb-go code generation
1325
uses: actions/github-script@v6
1426
with:
15-
github-token: ${{ secrets.GH_CQ_BOT }}
27+
github-token: ${{ steps.app-token.outputs.token }}
1628
script: |
1729
github.rest.actions.createWorkflowDispatch({
1830
owner: 'cloudquery',
@@ -23,7 +35,7 @@ jobs:
2335
- name: Trigger plugin-pb-python code generation
2436
uses: actions/github-script@v6
2537
with:
26-
github-token: ${{ secrets.GH_CQ_BOT }}
38+
github-token: ${{ steps.app-token.outputs.token }}
2739
script: |
2840
github.rest.actions.createWorkflowDispatch({
2941
owner: 'cloudquery',
@@ -34,7 +46,7 @@ jobs:
3446
- name: Trigger plugin-pb-java code generation
3547
uses: actions/github-script@v6
3648
with:
37-
github-token: ${{ secrets.GH_CQ_BOT }}
49+
github-token: ${{ steps.app-token.outputs.token }}
3850
script: |
3951
github.rest.actions.createWorkflowDispatch({
4052
owner: 'cloudquery',
@@ -45,7 +57,7 @@ jobs:
4557
- name: Trigger plugin-pb-javascript code generation
4658
uses: actions/github-script@v6
4759
with:
48-
github-token: ${{ secrets.GH_CQ_BOT }}
60+
github-token: ${{ steps.app-token.outputs.token }}
4961
script: |
5062
github.rest.actions.createWorkflowDispatch({
5163
owner: 'cloudquery',

0 commit comments

Comments
 (0)