Compare commits

...

2 Commits

Author SHA1 Message Date
Tom Hu
2f860c21a3 fix: update label 2024-12-18 15:40:17 -03:00
Tom Hu
7604d0eb69 fix: update statment 2024-12-18 15:17:22 -03:00

View File

@@ -168,12 +168,13 @@ runs:
- name: Set fork - name: Set fork
shell: bash shell: bash
run: | run: |
if [ -n "$GITHUB_EVENT_PULL_REQUEST_HEAD_REPO_FULL_NAME" ] && [ "${GITHUB_EVENT_PULL_REQUEST_HEAD_REPO_FULL_NAME}" != "$GITHUB_REPOSITORY" ]; CC_FORK="false"
if [ -n "$GITHUB_EVENT_PULL_REQUEST_HEAD_REPO_FULL_NAME" ] && [ "$GITHUB_EVENT_PULL_REQUEST_HEAD_REPO_FULL_NAME" != "$GITHUB_REPOSITORY" ];
then then
echo -e "\033[0;32m==>\033[0m Fork detected" echo -e "\033[0;32m==>\033[0m Fork detected"
CC_FORK="true" CC_FORK="true"
echo "CC_FORK=$CC_FORK" >> "$GITHUB_ENV"
fi fi
echo "CC_FORK=$CC_FORK" >> "$GITHUB_ENV"
env: env:
GITHUB_EVENT_PULL_REQUEST_HEAD_LABEL: ${{ github.event.pull_request.head.label }} GITHUB_EVENT_PULL_REQUEST_HEAD_LABEL: ${{ github.event.pull_request.head.label }}
GITHUB_EVENT_PULL_REQUEST_HEAD_REPO_FULL_NAME: ${{ github.event.pull_request.head.repo.full_name }} GITHUB_EVENT_PULL_REQUEST_HEAD_REPO_FULL_NAME: ${{ github.event.pull_request.head.repo.full_name }}
@@ -183,10 +184,10 @@ runs:
- name: Get and set token - name: Get and set token
shell: bash shell: bash
run: | run: |
if [ "${{ inputs.use_oidc }}" == 'true' && "$CC_FORK" != 'true' ]; if [ "${{ inputs.use_oidc }}" == 'true' ] && [ "$CC_FORK" != 'true' ];
then then
# {"count":1984,"value":"***"} # {"count":1984,"value":"***"}
echo -e "\033[0;32m==>\033[0m Requesting OIDC token from ${ACTION_ID_TOKEN_REQUEST_URL}" echo -e "\033[0;32m==>\033[0m Requesting OIDC token from '$ACTIONS_ID_TOKEN_REQUEST_URL'"
CC_TOKEN=$(curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=https://codecov.io" | cut -d\" -f6) CC_TOKEN=$(curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=https://codecov.io" | cut -d\" -f6)
echo "CC_TOKEN=$CC_TOKEN" >> "$GITHUB_ENV" echo "CC_TOKEN=$CC_TOKEN" >> "$GITHUB_ENV"
elif [ -n "${{ env.CODECOV_TOKEN }}" ]; elif [ -n "${{ env.CODECOV_TOKEN }}" ];
@@ -207,7 +208,7 @@ runs:
run: | run: |
if [ -z "$CC_BRANCH" ] && [ -z "$CC_TOKEN" ] && [ "$CC_FORK" == 'true' ] if [ -z "$CC_BRANCH" ] && [ -z "$CC_TOKEN" ] && [ "$CC_FORK" == 'true' ]
then then
echo -e "\033[0;32m==>\033[0m Fork detected, tokenless uploading used" echo -e "\033[0;32m==>\033[0m Fork detected, setting branch to $GITHUB_EVENT_PULL_REQUEST_HEAD_LABEL"
TOKENLESS="$GITHUB_EVENT_PULL_REQUEST_HEAD_LABEL" TOKENLESS="$GITHUB_EVENT_PULL_REQUEST_HEAD_LABEL"
CC_BRANCH="$GITHUB_EVENT_PULL_REQUEST_HEAD_LABEL" CC_BRANCH="$GITHUB_EVENT_PULL_REQUEST_HEAD_LABEL"
echo "TOKENLESS=$TOKENLESS" >> "$GITHUB_ENV" echo "TOKENLESS=$TOKENLESS" >> "$GITHUB_ENV"