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:
Leo Feyer
2024-06-12 10:15:54 +02:00
committed by GitHub
parent 81c0a51dcc
commit 7594baaf0c

View File

@@ -46,12 +46,12 @@ const isPullRequestFromFork = (): boolean => {
};
const getToken = async (): Promise<string> => {
if (isPullRequestFromFork()) {
let token = core.getInput('token');
if (!token && isPullRequestFromFork()) {
core.info('==> Fork detected, tokenless uploading used');
process.env['TOKENLESS'] = context.payload.pull_request.head.label;
return Promise.resolve('');
}
let token = core.getInput('token');
let url = core.getInput('url');
const useOIDC = isTrue(core.getInput('use_oidc'));
if (useOIDC) {