Skip to content

Commit

Permalink
feat: add support for tokenless v3
Browse files Browse the repository at this point in the history
Signed-off-by: joseph-sentry <joseph.sawaya@sentry.io>
  • Loading branch information
joseph-sentry committed May 7, 2024
1 parent f691d46 commit b7e79c8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32778,7 +32778,7 @@ const getGitService = () => {
return 'github';
};
const isPullRequestFromFork = () => {
if (`${context.eventName}` !== 'pull_request' ||
if (`${context.eventName}` !== 'pull_request' &&
`${context.eventName}` !== 'pull_request_target') {
return false;
}
Expand All @@ -32790,6 +32790,7 @@ const isPullRequestFromFork = () => {
const getToken = () => buildExec_awaiter(void 0, void 0, void 0, function* () {
if (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');
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/buildExec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const getGitService = (): string => {

const isPullRequestFromFork = (): boolean => {
if (
`${context.eventName}` !== 'pull_request' ||
`${context.eventName}` !== 'pull_request' &&
`${context.eventName}` !== 'pull_request_target'
) {
return false;
Expand All @@ -47,6 +47,7 @@ const isPullRequestFromFork = (): boolean => {
const getToken = async (): Promise<string> => {
if (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');
Expand Down

0 comments on commit b7e79c8

Please sign in to comment.