From b1c91cc89837d34d2372c323e7712fd209f21d07 Mon Sep 17 00:00:00 2001 From: Ryan Kotzen Date: Wed, 27 Dec 2023 12:39:52 +0200 Subject: [PATCH] fix(skip-ci): catering for the case where base === head --- dist/index.js | 4 ++-- find-successful-workflow.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/index.js b/dist/index.js index 607ab12..edad66c 100644 --- a/dist/index.js +++ b/dist/index.js @@ -38119,9 +38119,9 @@ function findLastSkippedCommitAfterSha(baseSha, headSha, messagesToSkip = [], br newBaseSha = commit.sha; continue; } - return commit.sha; + return commit.sha === headSha ? baseSha : commit.sha; } - return newBaseSha; + return newBaseSha === headSha ? baseSha : newBaseSha; }); } /** diff --git a/find-successful-workflow.ts b/find-successful-workflow.ts index b00de99..2fe47e9 100644 --- a/find-successful-workflow.ts +++ b/find-successful-workflow.ts @@ -347,9 +347,9 @@ async function findLastSkippedCommitAfterSha( newBaseSha = commit.sha; continue; } - return commit.sha; + return commit.sha === headSha ? baseSha : commit.sha; } - return newBaseSha; + return newBaseSha === headSha ? baseSha : newBaseSha; } /**