Skip to content

Commit 6426ecd

Browse files
authored
feat: added github oidc token as a header (#471)
* added github oidc token as a header * added instance to audience
1 parent 138c096 commit 6426ecd

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

actions/get-vault-secrets/action.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,14 @@ runs:
6262
COMMON_SECRETS: ${{ inputs.common_secrets }}
6363
REPO: ${{ github.repository }}
6464

65+
- id: get-github-jwt-token
66+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
67+
with:
68+
script: |
69+
const jwt = await core.getIDToken("vault-github-actions-grafana-${{ inputs.vault_instance }}");
70+
core.setSecret(jwt);
71+
core.setOutput("github-jwt",jwt);
72+
6573
# Get the secrets
6674
- name: Import Secrets
6775
id: import-secrets
@@ -74,5 +82,6 @@ runs:
7482
jwtGithubAudience: "https://vault-github-actions.grafana-${{ inputs.vault_instance }}.net"
7583
extraHeaders: |
7684
Proxy-Authorization: Bearer ${{ steps.vault-iap-auth.outputs.id_token }}
85+
Proxy-Authorization-Token: Bearer ${{ steps.get-github-jwt-token.outputs.github-jwt }}
7786
secrets: |
7887
${{ steps.translate-secrets.outputs.secrets }}

0 commit comments

Comments
 (0)