From b203f00e21e8678aa5d26b967170503dbb855a18 Mon Sep 17 00:00:00 2001 From: joseph-sentry <136376984+joseph-sentry@users.noreply.github.com> Date: Wed, 14 May 2025 12:00:29 -0400 Subject: [PATCH] fix: OIDC on forks (#1823) --- action.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/action.yml b/action.yml index 3a6ee30..f99bba6 100644 --- a/action.yml +++ b/action.yml @@ -203,15 +203,17 @@ runs: GITHUB_REPOSITORY: ${{ github.repository }} - name: Get OIDC token - if: ${{ inputs.use_oidc == 'true' }} uses: actions/github-script@v7 id: oidc with: script: | - const id_token = await core.getIDToken(process.env.CC_OIDC_AUDIENCE) - return id_token + if (process.env.CC_USE_OIDC === 'true' && process.env.CC_FORK != 'true') { + const id_token = await core.getIDToken(process.env.CC_OIDC_AUDIENCE) + return id_token + } env: CC_OIDC_AUDIENCE: ${{ inputs.url || 'https://codecov.io' }} + CC_USE_OIDC: ${{ inputs.use_oidc }} - name: Get and set token shell: bash