Skip to content

Commit 6c5b693

Browse files
use correct audience when requesting oidc token (#1744)
* use correct audience when requesting oidc token * Update action.yml * Update action.yml --------- Co-authored-by: Tom Hu <[email protected]>
1 parent ad45165 commit 6c5b693

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

action.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ runs:
192192
then
193193
# {"count":1984,"value":"***"}
194194
echo -e "\033[0;32m==>\033[0m Requesting OIDC token from '$ACTIONS_ID_TOKEN_REQUEST_URL'"
195-
CC_TOKEN=$(curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=https://codecov.io" | cut -d\" -f6)
195+
CC_TOKEN=$(curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=$CC_OIDC_AUDIENCE" | cut -d\" -f6)
196196
echo "CC_TOKEN=$CC_TOKEN" >> "$GITHUB_ENV"
197197
elif [ -n "${{ env.CODECOV_TOKEN }}" ];
198198
then
@@ -206,6 +206,8 @@ runs:
206206
echo "CC_TOKEN=$CC_TOKEN" >> "$GITHUB_ENV"
207207
fi
208208
fi
209+
env:
210+
CC_OIDC_AUDIENCE: ${{ inputs.url || 'https://codecov.io' }}
209211

210212
- name: Override branch for forks
211213
shell: bash

0 commit comments

Comments
 (0)