Skip to content

Commit

Permalink
Update oidc2.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve-Glass authored Dec 6, 2024
1 parent e1d4895 commit 14b6925
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion .github/workflows/oidc2.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: OIDC Token Test
name: OIDC Token Test 2
on:
workflow_dispatch:
jobs:
Expand All @@ -15,3 +15,15 @@ jobs:
const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL']
core.setOutput('TOKEN', token.trim())
core.setOutput('IDTOKENURL', runtimeUrl.trim())
- run: |
IDTOKEN=$(curl -H "Authorization: bearer ${{steps.script.outputs.TOKEN}}" ${{steps.script.outputs.IDTOKENURL}} -H "Accept: application/json; api-version=2.0" -H "Content-Type: application/json" -d "{}" | jq -r '.value')
echo $IDTOKEN
jwtd() {
if [[ -x $(command -v jq) ]]; then
jq -R 'split(".") | .[0],.[1] | @base64d | fromjson' <<< "${1}"
echo "Signature: $(echo "${1}" | awk -F'.' '{print $3}')"
fi
}
jwtd $IDTOKEN
echo "idToken=${IDTOKEN}" >> $GITHUB_OUTPUT
id: tokenid

0 comments on commit 14b6925

Please sign in to comment.