mirror of
https://github.com/codecov/codecov-action.git
synced 2025-12-23 20:27:02 +08:00
Use an existing token even if the PR is from a fork (#1471)
Use a given token even if the PR is from a fork
This commit is contained in:
@@ -46,12 +46,12 @@ const isPullRequestFromFork = (): boolean => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const getToken = async (): Promise<string> => {
|
const getToken = async (): Promise<string> => {
|
||||||
if (isPullRequestFromFork()) {
|
let token = core.getInput('token');
|
||||||
|
if (!token && isPullRequestFromFork()) {
|
||||||
core.info('==> Fork detected, tokenless uploading used');
|
core.info('==> Fork detected, tokenless uploading used');
|
||||||
process.env['TOKENLESS'] = context.payload.pull_request.head.label;
|
process.env['TOKENLESS'] = context.payload.pull_request.head.label;
|
||||||
return Promise.resolve('');
|
return Promise.resolve('');
|
||||||
}
|
}
|
||||||
let token = core.getInput('token');
|
|
||||||
let url = core.getInput('url');
|
let url = core.getInput('url');
|
||||||
const useOIDC = isTrue(core.getInput('use_oidc'));
|
const useOIDC = isTrue(core.getInput('use_oidc'));
|
||||||
if (useOIDC) {
|
if (useOIDC) {
|
||||||
|
|||||||
Reference in New Issue
Block a user