From 23aa7c27815465510a3029127f172830dd3d9d34 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Mon, 19 Dec 2022 01:43:38 -0700 Subject: [PATCH] fixed bug with since_last_remote commit --- diff-sha.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/diff-sha.sh b/diff-sha.sh index f825c0465ae..61a499d91fd 100644 --- a/diff-sha.sh +++ b/diff-sha.sh @@ -194,12 +194,10 @@ else if [[ -z $INPUT_BASE_SHA ]]; then if [[ "$INPUT_SINCE_LAST_REMOTE_COMMIT" == "true" ]]; then - echo "::debug::Fetching remote current branch..." - PREVIOUS_SHA=$GITHUB_EVENT_BEFORE - + if ! git rev-parse --quiet --verify "$PREVIOUS_SHA^{commit}" 1>/dev/null 2>&1; then - PREVIOUS_SHA=$(git rev-parse origin/"$CURRENT_BRANCH") + PREVIOUS_SHA=$(git rev-parse "$CURRENT_BRANCH^1") fi else echo "::debug::Fetching remote target branch..."