From 62aef87f399ebe7787f227f1d53e17a089874097 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Thu, 3 Nov 2022 12:08:29 -0600 Subject: [PATCH] Updated diff-sha.sh --- diff-sha.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/diff-sha.sh b/diff-sha.sh index 891d34ed..0f953c85 100644 --- a/diff-sha.sh +++ b/diff-sha.sh @@ -72,8 +72,6 @@ if [[ -z $GITHUB_BASE_REF ]]; then TARGET_BRANCH=${GITHUB_REF/refs\/heads\//} && exit_status=$? || exit_status=$? CURRENT_BRANCH=$TARGET_BRANCH && exit_status=$? || exit_status=$? - git fetch --no-tags -u --progress --depth="$INPUT_FETCH_DEPTH" origin "$TARGET_BRANCH":"$TARGET_BRANCH" - if [[ -z $INPUT_BASE_SHA ]]; then if [[ -n "$INPUT_SINCE" ]]; then echo "::debug::Getting base SHA for '$INPUT_SINCE'..." @@ -84,6 +82,7 @@ if [[ -z $GITHUB_BASE_REF ]]; then exit 1 fi else + git fetch --no-tags -u --progress --depth="$INPUT_FETCH_DEPTH" origin "$TARGET_BRANCH":"$TARGET_BRANCH" PREVIOUS_SHA=$(git rev-list --no-merges -n 1 "$TARGET_BRANCH" 2>&1) && exit_status=$? || exit_status=$? if [[ -z "$PREVIOUS_SHA" ]]; then @@ -112,6 +111,7 @@ if [[ -z $GITHUB_BASE_REF ]]; then fi fi else + git fetch --no-tags -u --progress --depth="$INPUT_FETCH_DEPTH" origin "$TARGET_BRANCH":"$TARGET_BRANCH" PREVIOUS_SHA=$INPUT_BASE_SHA TARGET_BRANCH=$(git name-rev --name-only "$PREVIOUS_SHA" 2>&1) && exit_status=$? || exit_status=$? CURRENT_BRANCH=$TARGET_BRANCH