mirror of
https://github.com/codecov/codecov-action.git
synced 2025-12-08 08:06:27 +00:00
fix: update tokenless branch logic (#1650)
* fix: update tokenless branch logic * fix: use the github context * fix: use double quotes * fix: lots of quotes * fix: ai fixes * fix: just shove it in * fix: more ai fixes * fix: missing double quote * fix: more clenaup * fix: add CC_BRANCH setting for not forks * fix: cleanup * fix: more cleanup
This commit is contained in:
21
action.yml
21
action.yml
@@ -175,13 +175,32 @@ runs:
|
||||
echo "CODECOV_TOKEN=$CODECOV_TOKEN" >> $GITHUB_ENV
|
||||
fi
|
||||
fi
|
||||
|
||||
- name: Override branch for forks
|
||||
shell: bash
|
||||
run: |
|
||||
if [ -z "$CC_BRANCH" ] && [ -z "$CODECOV_TOKEN" ] && [ "${GITHUB_EVENT_PULL_REQUEST_REPO_FULL_NAME}" != "$GITHUB_REPOSITORY" ];
|
||||
then
|
||||
echo -e "\033[0;32m==>\033[0m Fork detected, tokenless uploading used"
|
||||
TOKENLESS="$GITHUB_EVENT_PULL_REQUEST_HEAD_LABEL"
|
||||
CC_BRANCH="$GITHUB_EVENT_PULL_REQUEST_HEAD_LABEL"
|
||||
echo "TOKENLESS=$TOKENLESS" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
echo "CC_BRANCH=$CC_BRANCH" >> $GITHUB_ENV
|
||||
env:
|
||||
CC_BRANCH: ${{ inputs.override_branch }}
|
||||
GITHUB_EVENT_PULL_REQUEST_HEAD_LABEL: ${{ github.event.pull_request.head.label }}
|
||||
GITHUB_EVENT_PULL_REQUEST_REPO_FULL_NAME: ${{ github.event.pull_request.repo.full_name }}
|
||||
GITHUB_REPOSITORY: ${{ github.repository }}
|
||||
|
||||
- name: Upload coverage to Codecov
|
||||
run: ${GITHUB_ACTION_PATH}/dist/codecov.sh
|
||||
shell: bash
|
||||
working-directory: ${{ inputs.working-directory }}
|
||||
env:
|
||||
CC_BINARY: ${{ inputs.binary }}
|
||||
CC_BRANCH: ${{ inputs.override_branch }}
|
||||
CC_BRANCH: $CC_BRANCH
|
||||
CC_BUILD: ${{ inputs.override_build }}
|
||||
CC_BUILD_URL: ${{ inputs.override_build_url }}
|
||||
CC_CODE: ${{ inputs.report_code }}
|
||||
|
||||
Reference in New Issue
Block a user