Skip to content

Commit

Permalink
use correct audience when requesting oidc token (#1744)
Browse files Browse the repository at this point in the history
* use correct audience when requesting oidc token

* Update action.yml

* Update action.yml

---------

Co-authored-by: Tom Hu <[email protected]>
  • Loading branch information
juho9000 and thomasrockhu-codecov authored Jan 21, 2025
1 parent ad45165 commit 6c5b693
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ runs:
then
# {"count":1984,"value":"***"}
echo -e "\033[0;32m==>\033[0m Requesting OIDC token from '$ACTIONS_ID_TOKEN_REQUEST_URL'"
CC_TOKEN=$(curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=https://codecov.io" | cut -d\" -f6)
CC_TOKEN=$(curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=$CC_OIDC_AUDIENCE" | cut -d\" -f6)
echo "CC_TOKEN=$CC_TOKEN" >> "$GITHUB_ENV"
elif [ -n "${{ env.CODECOV_TOKEN }}" ];
then
Expand All @@ -206,6 +206,8 @@ runs:
echo "CC_TOKEN=$CC_TOKEN" >> "$GITHUB_ENV"
fi
fi
env:
CC_OIDC_AUDIENCE: ${{ inputs.url || 'https://codecov.io' }}

- name: Override branch for forks
shell: bash
Expand Down

0 comments on commit 6c5b693

Please sign in to comment.