File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -195,6 +195,30 @@ jobs:
195195 echo "push=false" >> $GITHUB_OUTPUT
196196 fi
197197
198+ - name : Debug OIDC claims
199+ if : steps.can-push.outputs.push == 'true'
200+ run : |
201+ echo "repo=${{ github.repository }}"
202+ echo "ref=${{ github.ref }}"
203+ echo "event=${{ github.event_name }}"
204+ echo "head=${{ github.event.pull_request.head.repo.full_name }}"
205+ token_json=$(curl -sS -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \
206+ "${ACTIONS_ID_TOKEN_REQUEST_URL}&audience=sts.amazonaws.com")
207+ python - <<'PY'
208+ import base64,json,sys
209+ token_json = sys.stdin.read()
210+ token = json.loads(token_json).get("value","")
211+ if not token :
212+ print("OIDC token missing")
213+ sys.exit(0)
214+ payload = token.split(".")[1]
215+ payload += "=" * ((4 - len(payload) % 4) % 4)
216+ data = json.loads(base64.urlsafe_b64decode(payload))
217+ print(f"oidc.aud={data.get('aud')}")
218+ print(f"oidc.sub={data.get('sub')}")
219+ PY
220+ <<<"$token_json"
221+
198222 - name : Determine Docker tag
199223 id : docker-tag
200224 run : |
You can’t perform that action at this time.
0 commit comments