mirror of
https://github.com/codecov/codecov-action.git
synced 2026-02-09 12:37:26 +00:00
fix: add logic to bypass token for forks
This commit is contained in:
parent
ae7230e0f1
commit
4960f3d5e8
3 changed files with 22 additions and 1 deletions
9
dist/index.js
vendored
9
dist/index.js
vendored
|
|
@ -32562,7 +32562,16 @@ const getGitService = () => {
|
|||
}
|
||||
return 'github';
|
||||
};
|
||||
const isFork = () => {
|
||||
const baseLabel = context.payload.pull_request.base.label;
|
||||
const headLabel = context.payload.pull_request.head.label;
|
||||
return (baseLabel.split(':')[0] !== headLabel.split(':')[0]);
|
||||
};
|
||||
const getToken = () => buildExec_awaiter(void 0, void 0, void 0, function* () {
|
||||
if (isFork) {
|
||||
core.info('==> Fork detected, tokenless uploading used');
|
||||
return Promise.resolve('');
|
||||
}
|
||||
let token = core.getInput('token');
|
||||
let url = core.getInput('url');
|
||||
const useOIDC = isTrue(core.getInput('use_oidc'));
|
||||
|
|
|
|||
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
|
|
@ -29,7 +29,19 @@ const getGitService = (): string => {
|
|||
return 'github';
|
||||
};
|
||||
|
||||
const isFork = (): boolean => {
|
||||
const baseLabel = context.payload.pull_request.base.label;
|
||||
const headLabel = context.payload.pull_request.head.label;
|
||||
|
||||
return (baseLabel.split(':')[0] !== headLabel.split(':')[0]);
|
||||
};
|
||||
|
||||
const getToken = async (): Promise<string> => {
|
||||
if (isFork) {
|
||||
core.info('==> Fork detected, tokenless uploading used');
|
||||
return Promise.resolve('');
|
||||
}
|
||||
|
||||
let token = core.getInput('token');
|
||||
let url = core.getInput('url');
|
||||
const useOIDC = isTrue(core.getInput('use_oidc'));
|
||||
|
|
|
|||
Loading…
Reference in a new issue