From fad01cd3732af2bb19c303964a8f07b5d16fa437 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Fri, 18 Nov 2022 06:17:59 -0700 Subject: [PATCH] chore: fix error locating last remote commit sha --- diff-sha.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/diff-sha.sh b/diff-sha.sh index 2c583f28..ebfb22a2 100644 --- a/diff-sha.sh +++ b/diff-sha.sh @@ -158,6 +158,8 @@ else # shellcheck disable=SC2086 git fetch -u --progress $EXTRA_ARGS --depth="$INPUT_FETCH_DEPTH" origin +refs/heads/"$TARGET_BRANCH":refs/remotes/origin/"$TARGET_BRANCH" git branch --track "$TARGET_BRANCH" origin/"$TARGET_BRANCH" 2>/dev/null || true + else + git fetch $EXTRA_ARGS -u --progress --depth="$INPUT_FETCH_DEPTH" origin +"$GITHUB_REF":refs/remotes/origin/"$CURRENT_BRANCH" fi echo "::debug::Getting HEAD SHA..."