Skip to content

Commit 7594baa

Browse files
authored
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
1 parent 81c0a51 commit 7594baa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/buildExec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ const isPullRequestFromFork = (): boolean => {
4646
};
4747

4848
const getToken = async (): Promise<string> => {
49-
if (isPullRequestFromFork()) {
49+
let token = core.getInput('token');
50+
if (!token && isPullRequestFromFork()) {
5051
core.info('==> Fork detected, tokenless uploading used');
5152
process.env['TOKENLESS'] = context.payload.pull_request.head.label;
5253
return Promise.resolve('');
5354
}
54-
let token = core.getInput('token');
5555
let url = core.getInput('url');
5656
const useOIDC = isTrue(core.getInput('use_oidc'));
5757
if (useOIDC) {

0 commit comments

Comments
 (0)