Skip to content

Commit f1a8669

Browse files
authored
Merge pull request #15 from masa0902dev/feat/actions-with-jwt
use actions env ACTIONS_ID_TOKEN_REQUEST_URL
2 parents 25aa78b + 79880c3 commit f1a8669

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

.github/workflows/saveToFirestore.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ jobs:
3838
echo "Requesting OIDC Token..."
3939
echo "Token Request: $ACTIONS_ID_TOKEN_REQUEST_TOKEN"
4040
41-
# jwt_token=$(curl -H "Authorization: Bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \
42-
# -H "Accept: application/json" \
43-
# "https://token.actions.githubusercontent.com/?audience=https://accounts.google.com")
44-
# echo "JWT Token Response: $jwt_token"
45-
46-
curl -v -H "Authorization: Bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \
41+
jwt_token=$(curl -H "Authorization: Bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \
4742
-H "Accept: application/json" \
48-
"https://token.actions.githubusercontent.com/?audience=https://accounts.google.com"
43+
"${ACTIONS_ID_TOKEN_REQUEST_URL}" | jq -r '.value')
44+
echo "JWT Token Response: $jwt_token"
45+
46+
# curl -v -H "Authorization: Bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \
47+
# -H "Accept: application/json" \
48+
# "https://token.actions.githubusercontent.com/?audience=https://accounts.google.com"
4949
5050
echo "JWT_TOKEN=$jwt_token" >> $GITHUB_ENV
5151

0 commit comments

Comments
 (0)