Skip to content

Commit e0bc381

Browse files
committed
chore(ci): Replace GH_CQ_BOT PAT with GitHub App tokens
Replace the non-expiring personal access token (GH_CQ_BOT) with short-lived tokens from the cloudquery-ci GitHub App using actions/create-github-app-token@v3.
1 parent 1ec4d4d commit e0bc381

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

.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: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,17 @@ 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-contents: write
1219
- name: Trigger plugin-pb-go code generation
1320
uses: actions/github-script@v6
1421
with:
15-
github-token: ${{ secrets.GH_CQ_BOT }}
22+
github-token: ${{ steps.app-token.outputs.token }}
1623
script: |
1724
github.rest.actions.createWorkflowDispatch({
1825
owner: 'cloudquery',
@@ -23,7 +30,7 @@ jobs:
2330
- name: Trigger plugin-pb-python code generation
2431
uses: actions/github-script@v6
2532
with:
26-
github-token: ${{ secrets.GH_CQ_BOT }}
33+
github-token: ${{ steps.app-token.outputs.token }}
2734
script: |
2835
github.rest.actions.createWorkflowDispatch({
2936
owner: 'cloudquery',
@@ -34,7 +41,7 @@ jobs:
3441
- name: Trigger plugin-pb-java code generation
3542
uses: actions/github-script@v6
3643
with:
37-
github-token: ${{ secrets.GH_CQ_BOT }}
44+
github-token: ${{ steps.app-token.outputs.token }}
3845
script: |
3946
github.rest.actions.createWorkflowDispatch({
4047
owner: 'cloudquery',
@@ -45,7 +52,7 @@ jobs:
4552
- name: Trigger plugin-pb-javascript code generation
4653
uses: actions/github-script@v6
4754
with:
48-
github-token: ${{ secrets.GH_CQ_BOT }}
55+
github-token: ${{ steps.app-token.outputs.token }}
4956
script: |
5057
github.rest.actions.createWorkflowDispatch({
5158
owner: 'cloudquery',

0 commit comments

Comments
 (0)