Skip to content

Commit 373fd71

Browse files
fix: update CODECOV_TOKEN and fix tokenless (#1688)
* fix: add space * fix: update CODECOV_TOKEN if set with env
1 parent 288befb commit 373fd71

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

action.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,9 @@ runs:
173173
# {"count":1984,"value":"***"}
174174
CC_TOKEN=$(curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=https://codecov.io" | cut -d\" -f6)
175175
echo "CC_TOKEN=$CC_TOKEN" >> "$GITHUB_ENV"
176+
elif [ -n "${{ env.CODECOV_TOKEN }}" ];
177+
then
178+
echo "CC_TOKEN=${{ env.CODECOV_TOKEN }}" >> "$GITHUB_ENV"
176179
else
177180
if [ -n ${{ inputs.token }} ];
178181
then
@@ -184,7 +187,7 @@ runs:
184187
- name: Override branch for forks
185188
shell: bash
186189
run: |
187-
if [ -z "$CC_BRANCH" ] && [ -z "$CC_TOKEN" ] && [ -n "$GITHUB_EVENT_PULL_REQUEST_REPO_FULL_NAME"] && [ "${GITHUB_EVENT_PULL_REQUEST_REPO_FULL_NAME}" != "$GITHUB_REPOSITORY" ];
190+
if [ -z "$CC_BRANCH" ] && [ -z "$CC_TOKEN" ] && [ -n "$GITHUB_EVENT_PULL_REQUEST_REPO_FULL_NAME" ] && [ "${GITHUB_EVENT_PULL_REQUEST_REPO_FULL_NAME}" != "$GITHUB_REPOSITORY" ];
188191
then
189192
echo -e "\033[0;32m==>\033[0m Fork detected, tokenless uploading used"
190193
TOKENLESS="$GITHUB_EVENT_PULL_REQUEST_HEAD_LABEL"

0 commit comments

Comments
 (0)