From 8dc46ae460cb5adfef1a3d23da9ddbc66f5b7dca Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Mon, 7 Nov 2022 08:04:54 -0700 Subject: [PATCH] fix: similar commit hashes --- diff-sha.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/diff-sha.sh b/diff-sha.sh index 56a16e0d..443d3b59 100644 --- a/diff-sha.sh +++ b/diff-sha.sh @@ -212,9 +212,10 @@ else PREVIOUS_SHA=$(git rev-list -n 1 "$TARGET_BRANCH" 2>&1) && exit_status=$? || exit_status=$? fi - if [[ -z "$PREVIOUS_SHA" ]]; then + if [[ -z "$PREVIOUS_SHA" || "$PREVIOUS_SHA" == "$CURRENT_SHA" ]]; then PREVIOUS_SHA=$GITHUB_EVENT_PULL_REQUEST_BASE_SHA && exit_status=$? || exit_status=$? fi + echo "::debug::Previous SHA: $PREVIOUS_SHA" else PREVIOUS_SHA=$INPUT_BASE_SHA && exit_status=$? || exit_status=$?