From e77dab65bffcbc621e169f31ec9e12acac61a526 Mon Sep 17 00:00:00 2001 From: Tom Hu Date: Mon, 8 Mar 2021 19:11:29 -0500 Subject: [PATCH] Do commit SHA edit for pull_request* --- dist/index.js | 6 +++--- src/buildExec.ts | 8 +++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/dist/index.js b/dist/index.js index 98cba2f..c031b7f 100644 --- a/dist/index.js +++ b/dist/index.js @@ -59626,9 +59626,9 @@ var buildExec = function () { if (overrideCommit) { execArgs.push('-C', "" + overrideCommit); } - else { - // attempt commit detection - execArgs.push('-C', "" + context.sha); + else if ("" + context.eventName == 'pull_request' || + "" + context.eventName == 'pull_request_target') { + execArgs.push('-C', "" + context.event.pull_request.head.sha); } if (overridePr) { execArgs.push('-P', "" + overridePr); diff --git a/src/buildExec.ts b/src/buildExec.ts index a9ef741..a359ff3 100644 --- a/src/buildExec.ts +++ b/src/buildExec.ts @@ -133,9 +133,11 @@ const buildExec = () => { } if (overrideCommit) { execArgs.push('-C', `${overrideCommit}`); - } else { - // attempt commit detection - execArgs.push('-C', `${context.sha}`); + } else if ( + `${context.eventName}` == 'pull_request' || + `${context.eventName}` == 'pull_request_target' + ) { + execArgs.push('-C', `${context.event.pull_request.head.sha}`); } if (overridePr) { execArgs.push('-P', `${overridePr}`);