mirror of
https://github.com/codecov/codecov-action.git
synced 2025-12-08 16:16:24 +00:00
fix: OIDC on forks (#1823)
This commit is contained in:
@@ -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: |
|
||||||
|
if (process.env.CC_USE_OIDC === 'true' && process.env.CC_FORK != 'true') {
|
||||||
const id_token = await core.getIDToken(process.env.CC_OIDC_AUDIENCE)
|
const id_token = await core.getIDToken(process.env.CC_OIDC_AUDIENCE)
|
||||||
return id_token
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user