From 9301ab051930cc01e6bb8653208e56246571ee32 Mon Sep 17 00:00:00 2001 From: Tom Hu Date: Thu, 14 Nov 2024 22:19:11 -0500 Subject: [PATCH] fix: more clenaup --- action.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index a77ce86..3e56175 100644 --- a/action.yml +++ b/action.yml @@ -179,7 +179,7 @@ runs: - name: Override branch for forks shell: bash run: | - if [ -z "$CC_BRANCH" ] && [ -z "$CODECOV_TOKEN" ] && [ "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.repository }}" ]; + 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" @@ -188,9 +188,11 @@ runs: echo "CC_BRANCH=$CC_BRANCH" >> $GITHUB_ENV fi env: - GITHUB_EVENT_PULL_REQUEST_HEAD_LABEL: ${{ github.event.pull_request.head.label }} CC_BRANCH: ${{ inputs.override_branch }} CC_TOKEN: ${{ env.CODECOV_TOKEN }} + 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