Skip to content

Commit 4df3097

Browse files
authoredSep 18, 2024··
github-action: use ephemeral tokens with the required permissions (#198)
1 parent d4607cc commit 4df3097

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed
 

‎.github/workflows/update-specs.yml

+14-2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,18 @@ jobs:
1919
steps:
2020
- uses: actions/checkout@v4
2121

22+
- name: Get token
23+
id: get_token
24+
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0
25+
with:
26+
app_id: ${{ secrets.OBS_AUTOMATION_APP_ID }}
27+
private_key: ${{ secrets.OBS_AUTOMATION_APP_PEM }}
28+
permissions: >-
29+
{
30+
"contents": "write",
31+
"pull_requests": "write"
32+
}
33+
2234
- uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
2335
with:
2436
registry: ghcr.io
@@ -29,13 +41,13 @@ jobs:
2941
with:
3042
command: --experimental compose diff
3143
env:
32-
GITHUB_TOKEN: ${{ secrets.UPDATECLI_GH_TOKEN }}
44+
GITHUB_TOKEN: ${{ steps.get_token.outputs.token }}
3345

3446
- uses: elastic/oblt-actions/updatecli/run@v1
3547
with:
3648
command: --experimental compose apply
3749
env:
38-
GITHUB_TOKEN: ${{ secrets.UPDATECLI_GH_TOKEN }}
50+
GITHUB_TOKEN: ${{ steps.get_token.outputs.token }}
3951

4052
- if: failure()
4153
uses: elastic/oblt-actions/slack/send@v1

0 commit comments

Comments
 (0)
Please sign in to comment.