Skip to content

Commit 11eeb8d

Browse files
wax911home-lab
andauthored
chore(ci): use GitHub App token for stack sync workflows (#495)
Co-authored-by: home-lab <home-lab@homelab>
1 parent 541c65e commit 11eeb8d

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

.github/workflows/nightly-stack-sync.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,19 @@ jobs:
1515
name: Regenerate stacks and open PR if drifted
1616
runs-on: ubuntu-latest
1717
steps:
18+
- name: Generate app token
19+
uses: actions/create-github-app-token@v2
20+
id: app-token
21+
with:
22+
app-id: ${{ secrets.APP_ID }}
23+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
24+
1825
- name: Checkout dev branch
1926
uses: actions/checkout@v6
2027
with:
2128
ref: dev
2229
fetch-depth: 0
30+
token: ${{ steps.app-token.outputs.token }}
2331

2432
- name: Set up Python
2533
uses: actions/setup-python@v6
@@ -60,7 +68,7 @@ jobs:
6068
if: steps.drift.outputs.drifted == 'true'
6169
uses: peter-evans/create-pull-request@v8
6270
with:
63-
token: ${{ secrets.GITHUB_TOKEN }}
71+
token: ${{ steps.app-token.outputs.token }}
6472
signoff: true
6573
delete-branch: true
6674
commit-message: "chore(stacks): nightly regeneration from compose sources"

.github/workflows/renovate-stack-sync.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,19 @@ jobs:
1313
if: github.actor == 'renovate[bot]' && github.event.pull_request.head.repo.full_name == github.repository
1414
runs-on: ubuntu-latest
1515
steps:
16+
- name: Generate app token
17+
uses: actions/create-github-app-token@v2
18+
id: app-token
19+
with:
20+
app-id: ${{ secrets.APP_ID }}
21+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
22+
1623
- name: Checkout Renovate branch
1724
uses: actions/checkout@v6
1825
with:
1926
ref: ${{ github.event.pull_request.head.ref }}
2027
fetch-depth: 0
28+
token: ${{ steps.app-token.outputs.token }}
2129

2230
- name: Set up Python
2331
uses: actions/setup-python@v6
@@ -33,5 +41,6 @@ jobs:
3341
- name: Commit regenerated stacks when drift exists
3442
uses: stefanzweifel/git-auto-commit-action@v7
3543
with:
44+
token: ${{ steps.app-token.outputs.token }}
3645
commit_message: "chore(stacks): sync generated stacks for renovate update"
3746
file_pattern: stacks/*.yml

0 commit comments

Comments
 (0)