Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update tokenless branch logic #1650

Merged
merged 12 commits into from
Nov 15, 2024
18 changes: 17 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,29 @@
echo "CODECOV_TOKEN=$CODECOV_TOKEN" >> $GITHUB_ENV
fi
fi

- name: Override branch for forks
shell: bash
run: |
CC_BRANCH=${{ inputs.override_branch }}

is_Fork=$(${{ github.event.pull_request.head.repo.full_name }} != ${{ github.repository }})
if [ -z $CC_BRANCH ] && [ -z $CODECOV_TOKEN ] && [ "$is_fork" == "true" ];
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
echo "CC_BRANCH=$CC_BRANCH" >> $GITHUB_ENV
fi
Fixed Show fixed Hide fixed

- 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 }}
Expand Down
Loading