mirror of
https://github.com/codecov/codecov-action.git
synced 2026-02-08 03:57:26 +00:00
fix: set the token
This commit is contained in:
parent
cf7e3eafa1
commit
74dc1b1917
1 changed files with 14 additions and 7 deletions
21
action.yml
21
action.yml
|
|
@ -148,14 +148,21 @@ runs:
|
|||
run: |
|
||||
git config --global --add safe.directory ${{ github.workspace }}
|
||||
|
||||
- name: Get and set OIDC token
|
||||
if: ${{ inputs.use_oidc == 'true' }}
|
||||
- name: Get and set token
|
||||
shell: bash
|
||||
run: |
|
||||
# {"count":1984,"value":"***"}
|
||||
CODECOV_TOKEN=$(curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=api://AzureADTokenExchange" | cut -d\' -f6)
|
||||
echo "CODECOV_TOKEN=$CODECOV_TOKEN" >> $GITHUB_ENV
|
||||
echo $CODECOV_TOKEN
|
||||
if [ ${{ inputs.use_oidc }} == 'true' ];
|
||||
then
|
||||
# {"count":1984,"value":"***"}
|
||||
CODECOV_TOKEN=$(curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=api://AzureADTokenExchange" | cut -d\' -f6)
|
||||
echo "CODECOV_TOKEN=$CODECOV_TOKEN" >> $GITHUB_ENV
|
||||
else
|
||||
if [ -n ${{ inputs.token }} ];
|
||||
then
|
||||
CODECOV_TOKEN=${{ inputs.token }}
|
||||
echo "CODECOV_TOKEN=$CODECOV_TOKEN" >> $GITHUB_ENV
|
||||
fi
|
||||
fi
|
||||
- name: Upload coverage to Codecov
|
||||
run: ./dist/codecov.sh
|
||||
shell: bash
|
||||
|
|
@ -197,6 +204,6 @@ runs:
|
|||
CC_SKIP_VALIDATION: ${{ inputs.skip_validation }}
|
||||
CC_SLUG: ${{ inputs.slug }}
|
||||
CC_SWIFT_PROJECT: ${{ inputs.swift_project }}
|
||||
CC_TOKEN: $CODECOV_TOKEN || ${{ inputs.token }}
|
||||
CC_TOKEN: $CODECOV_TOKEN
|
||||
CC_VERBOSE: ${{ inputs.verbose }}
|
||||
CC_VERSION: ${{ inputs.version }}
|
||||
|
|
|
|||
Loading…
Reference in a new issue