diff --git a/dist/index.js b/dist/index.js index 72c16629..a7b8fa69 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; @@ -3565,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 0f0fdd61..e78d223e 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 @@ -74,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[],