fix: OIDC on forks (#1823)

This commit is contained in:
joseph-sentry
2025-05-14 12:00:29 -04:00
committed by GitHub
parent ad3126e916
commit b203f00e21

View File

@@ -203,15 +203,17 @@ runs:
GITHUB_REPOSITORY: ${{ github.repository }} GITHUB_REPOSITORY: ${{ github.repository }}
- name: Get OIDC token - name: Get OIDC token
if: ${{ inputs.use_oidc == 'true' }}
uses: actions/github-script@v7 uses: actions/github-script@v7
id: oidc id: oidc
with: with:
script: | script: |
const id_token = await core.getIDToken(process.env.CC_OIDC_AUDIENCE) if (process.env.CC_USE_OIDC === 'true' && process.env.CC_FORK != 'true') {
return id_token const id_token = await core.getIDToken(process.env.CC_OIDC_AUDIENCE)
return id_token
}
env: env:
CC_OIDC_AUDIENCE: ${{ inputs.url || 'https://codecov.io' }} CC_OIDC_AUDIENCE: ${{ inputs.url || 'https://codecov.io' }}
CC_USE_OIDC: ${{ inputs.use_oidc }}
- name: Get and set token - name: Get and set token
shell: bash shell: bash