Skip to content

Commit 0919ecd

Browse files
authored
Modify GitHub Actions workflow for template cleanup
Updated permissions and added token retrieval step for GitHub actions.
1 parent 5610d39 commit 0919ecd

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

.github/workflows/template-cleanup.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- main
77

88
permissions:
9-
contents: write
9+
id-token: write
1010

1111
concurrency:
1212
group: template-cleanup-${{github.ref}}
@@ -23,8 +23,18 @@ jobs:
2323
runs-on: ubuntu-latest
2424
timeout-minutes: 15
2525
steps:
26+
- name: Get GitHub Token
27+
id: get-token
28+
uses: remal/github-repository-token-issuer@v1
29+
with:
30+
scopes: |
31+
contents: write
32+
workflows: write
33+
2634
- name: Checkout repository
2735
uses: actions/checkout@v6
36+
with:
37+
token: ${{steps.get-token.outputs.token}}
2838

2939
- name: Cleanup
3040
run: |
@@ -49,7 +59,6 @@ jobs:
4959
if: ${{github.event_name == 'push' && startsWith(github.ref, 'refs/heads/')}}
5060
uses: remal-github-actions/push-back@v2
5161
with:
52-
githubToken: ${{secrets.PUSH_BACK_TOKEN || github.token}}
5362
message: 'Template cleanup'
5463

5564
- name: Fail if the repository was changed before pushing back

0 commit comments

Comments
 (0)