Skip to content

Commit eda3754

Browse files
authored
Use vault to generate token (#143)
1 parent f647760 commit eda3754

File tree

3 files changed

+25
-4
lines changed

3 files changed

+25
-4
lines changed

.github/workflows/issue_commands.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,19 @@ jobs:
1818
persist-credentials: false
1919
- name: Install Actions
2020
run: npm install --production --prefix ./actions
21+
- name: Get secrets from vault
22+
id: get-secrets
23+
uses: grafana/shared-workflows/actions/get-vault-secrets@main
24+
with:
25+
repo_secrets: |
26+
AWS_DS_TOKEN_CREATOR_ID=aws-ds-token-creator:app_id
27+
AWS_DS_TOKEN_CREATOR_PEM=aws-ds-token-creator:pem
2128
- name: 'Generate token'
2229
id: generate_token
2330
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a
2431
with:
25-
app_id: ${{ secrets.AWS_DS_TOKEN_CREATOR_ID }}
26-
private_key: ${{ secrets.AWS_DS_TOKEN_CREATOR_PEM }}
32+
app_id: ${{ env.AWS_DS_TOKEN_CREATOR_ID }}
33+
private_key: ${{ env.AWS_DS_TOKEN_CREATOR_PEM }}
2734
- name: Run Commands
2835
uses: ./actions/commands
2936
with:

.github/workflows/pr-commands.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,19 @@ jobs:
2222
persist-credentials: false
2323
- name: Install Actions
2424
run: npm install --production --prefix ./actions
25+
- name: Get secrets from vault
26+
id: get-secrets
27+
uses: grafana/shared-workflows/actions/get-vault-secrets@main
28+
with:
29+
repo_secrets: |
30+
AWS_DS_TOKEN_CREATOR_ID=aws-ds-token-creator:app_id
31+
AWS_DS_TOKEN_CREATOR_PEM=aws-ds-token-creator:pem
2532
- name: 'Generate token'
2633
id: generate_token
2734
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a
2835
with:
29-
app_id: ${{ secrets.AWS_DS_TOKEN_CREATOR_ID }}
30-
private_key: ${{ secrets.AWS_DS_TOKEN_CREATOR_PEM }}
36+
app_id: ${{ env.AWS_DS_TOKEN_CREATOR_ID }}
37+
private_key: ${{ env.AWS_DS_TOKEN_CREATOR_PEM }}
3138
- name: Run Commands
3239
uses: ./actions/commands
3340
with:

.github/zizmor.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
rules:
2+
unpinned-uses:
3+
config:
4+
policies:
5+
actions/*: any
6+
github/*: any
7+
grafana/*: any

0 commit comments

Comments
 (0)