From 47db5bd435ab26939338ff899af621be52f44da4 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Thu, 1 Jun 2023 21:16:31 -0600 Subject: [PATCH] fix: bug retrieving base sha for force push (#1216) --- dist/index.js | Bin 318226 -> 318165 bytes dist/index.js.map | Bin 373819 -> 373740 bytes src/commitSha.ts | 8 +++----- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/dist/index.js b/dist/index.js index a6bcbb1881744ebcd4cb88129f3c013637db9d20..305fb823b4e94c2ae690813bbe70ba991ba084f7 100644 GIT binary patch delta 48 zcmbQVP5A0o;SJFqj2e^QoB2;RGLfFV!Gv$JgO^>izh}F@CnFFu0WtG-e@~Xf69LDf B5tRS{ delta 71 zcmcb*Rd~`i;SJFqlmD11Ox|FkKUq*fY;uDV@ATDA8HFbQFjWBx@=dM|Fqm9zAUpZ| ZcfMwQ&vt!JMj&PaV&?7oo-E5I0st3W8$AF3 diff --git a/dist/index.js.map b/dist/index.js.map index 7a2fba7e06136f1beeabb52145ffb1982147b8eb..aa3bfb7100d7712ae9dd46560cb9ebf8a4a7fb3c 100644 GIT binary patch delta 76 zcmdn}LhQ|Ru?@mplNA;v_Oy2ZPW%_&pM*is^<}tEN-_69R+9t->CdSkz#@r^xvQ3Qj&0GMwm>#MC diff --git a/src/commitSha.ts b/src/commitSha.ts index 5cfc0ed4..7999f166 100644 --- a/src/commitSha.ts +++ b/src/commitSha.ts @@ -359,11 +359,9 @@ export const getSHAForPullRequestEvent = async ( if (inputs.sinceLastRemoteCommit) { previousSha = env.GITHUB_EVENT_BEFORE - if (!previousSha) { - previousSha = await getParentSha({cwd: workingDirectory}) - } - - if (!previousSha) { + if ( + (await verifyCommitSha({sha: previousSha, cwd: workingDirectory})) !== 0 + ) { previousSha = env.GITHUB_EVENT_PULL_REQUEST_BASE_SHA } } else {