From 2ee76638a80d280a92d221250e907e292d09682d Mon Sep 17 00:00:00 2001 From: Dmytro <33125344+smay1613@users.noreply.github.com> Date: Tue, 22 Sep 2020 16:53:35 +0300 Subject: [PATCH 1/3] Add pull_request_target event to accepted event list --- src/main.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.ts b/src/main.ts index 0f0fdd61..307b9888 100644 --- a/src/main.ts +++ b/src/main.ts @@ -26,6 +26,7 @@ async function run(): Promise { let head: string | undefined switch (eventName) { + case 'pull_request_target': case 'pull_request': base = context.payload.pull_request?.base?.sha head = context.payload.pull_request?.head?.sha From 124b87b32e3949cc3d4d88abf8319428d949fecb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20G=C3=B3rny?= Date: Thu, 19 Nov 2020 10:26:06 +0100 Subject: [PATCH 2/3] add the dist files for pull req target --- dist/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/dist/index.js b/dist/index.js index 72c16629..cf953550 100644 --- a/dist/index.js +++ b/dist/index.js @@ -3529,6 +3529,7 @@ function run() { let base; let head; switch (eventName) { + case 'pull_request_target': case 'pull_request': base = (_b = (_a = github_1.context.payload.pull_request) === null || _a === void 0 ? void 0 : _a.base) === null || _b === void 0 ? void 0 : _b.sha; head = (_d = (_c = github_1.context.payload.pull_request) === null || _c === void 0 ? void 0 : _c.head) === null || _d === void 0 ? void 0 : _d.sha; From 1028587c8596c55a9d03d813a48aa1377f60b087 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20G=C3=B3rny?= Date: Tue, 26 Jan 2021 17:09:30 +0100 Subject: [PATCH 3/3] remove the check for head ahead of base --- dist/index.js | 5 ----- src/main.ts | 8 -------- 2 files changed, 13 deletions(-) diff --git a/dist/index.js b/dist/index.js index cf953550..a7b8fa69 100644 --- a/dist/index.js +++ b/dist/index.js @@ -3566,11 +3566,6 @@ function run() { core.setFailed(`The GitHub API for comparing the base and head commits for this ${github_1.context.eventName} event returned ${response.status}, expected 200. ` + "Please submit an issue on this action's GitHub repo."); } - // Ensure that the head commit is ahead of the base commit. - if (response.data.status !== 'ahead') { - core.setFailed(`The head commit for this ${github_1.context.eventName} event is not ahead of the base commit. ` + - "Please submit an issue on this action's GitHub repo."); - } // Get the changed files from the response payload. const files = response.data.files; const all = [], added = [], modified = [], removed = [], renamed = [], addedModified = []; diff --git a/src/main.ts b/src/main.ts index 307b9888..e78d223e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -75,14 +75,6 @@ async function run(): Promise { ) } - // Ensure that the head commit is ahead of the base commit. - if (response.data.status !== 'ahead') { - core.setFailed( - `The head commit for this ${context.eventName} event is not ahead of the base commit. ` + - "Please submit an issue on this action's GitHub repo." - ) - } - // Get the changed files from the response payload. const files = response.data.files const all = [] as string[],