Skip to content

Commit 4a8ddfc

Browse files
committed
chore(gh-actions): use gihtub app instead of a token
1 parent b863541 commit 4a8ddfc

File tree

3 files changed

+30
-3
lines changed

3 files changed

+30
-3
lines changed

.github/workflows/sync-deck.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ jobs:
1919
uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
2020
with:
2121
egress-policy: audit
22+
- name: Create GitHub App Token
23+
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf
24+
id: app-token
25+
with:
26+
app-id: ${{ vars.GH_APP_KONG_DOCS_ID }}
27+
private-key: ${{ secrets.GH_APP_KONG_DOCS_SECRET }}
28+
owner: Kong
29+
2230
- uses: Kong/setup-deck@v1
2331
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
2432
- name: Fetch OAS Data
@@ -27,10 +35,11 @@ jobs:
2735
npm ci
2836
node extract-help.js
2937
node fetch-versions.js
38+
3039
- name: Create pull request
3140
uses: peter-evans/create-pull-request@22a9089034f40e5a961c8808d113e2c98fb63676 # v7
3241
with:
3342
title: Sync Deck Releases
3443
commit-message: Sync Deck Releases
3544
labels: skip-changelog,review:general
36-
token: ${{ secrets.PAT }}
45+
token: ${{ steps.app-token.outputs.token }}

.github/workflows/sync-konnect-oas-data.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@ jobs:
1414
uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
1515
with:
1616
egress-policy: audit
17+
18+
- name: Create GitHub App Token
19+
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf
20+
id: app-token
21+
with:
22+
app-id: ${{ vars.GH_APP_KONG_DOCS_ID }}
23+
private-key: ${{ secrets.GH_APP_KONG_DOCS_SECRET }}
24+
owner: Kong
25+
1726
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
1827
- name: Fetch OAS Data
1928
run: |
@@ -26,4 +35,4 @@ jobs:
2635
title: Sync Konnect OAS Data
2736
commit-message: Sync Konnect OAS Data
2837
labels: skip-changelog,review:general
29-
token: ${{ secrets.PAT }}
38+
token: ${{ steps.app-token.outputs.token }}

.github/workflows/sync-kuma-submodule.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,15 @@ jobs:
4747
uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
4848
with:
4949
egress-policy: audit
50+
51+
- name: Create GitHub App Token
52+
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf
53+
id: app-token
54+
with:
55+
app-id: ${{ vars.GH_APP_KONG_DOCS_ID }}
56+
private-key: ${{ secrets.GH_APP_KONG_DOCS_SECRET }}
57+
owner: Kong
58+
5059
- name: 'Check-out current repo'
5160
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
5261
with:
@@ -79,7 +88,7 @@ jobs:
7988
author: kong-docs[bot] <team-docs@konghq.com>
8089
signoff: true
8190
branch: chore/upgrade-kuma-website
82-
token: ${{ secrets.PAT }}
91+
token: ${{ steps.app-token.outputs.token }}
8392
delete-branch: true
8493
labels: |
8594
skip-changelog

0 commit comments

Comments
 (0)