From c02c9607483dd908cfb50e906b3cb3b7fa05bfc6 Mon Sep 17 00:00:00 2001 From: Tom Hu Date: Wed, 18 Dec 2024 15:14:34 -0300 Subject: [PATCH] fix: update statment --- action.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/action.yml b/action.yml index ecea88427..84aafd44d 100644 --- a/action.yml +++ b/action.yml @@ -168,12 +168,13 @@ runs: - name: Set fork shell: bash 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 echo -e "\033[0;32m==>\033[0m Fork detected" CC_FORK="true" - echo "CC_FORK=$CC_FORK" >> "$GITHUB_ENV" fi + echo "CC_FORK=$CC_FORK" >> "$GITHUB_ENV" env: 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 }} @@ -183,7 +184,7 @@ runs: - name: Get and set token shell: bash run: | - if [ "${{ inputs.use_oidc }}" == 'true' && "$CC_FORK" != 'true' ]; + if [ "${{ inputs.use_oidc }}" == 'true' ] && [ "$CC_FORK" != 'true' ]; then # {"count":1984,"value":"***"} echo -e "\033[0;32m==>\033[0m Requesting OIDC token from ${ACTION_ID_TOKEN_REQUEST_URL}"