From bf1b284c20a4a7d2fe2cd146c4da60b9533338ac Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Thu, 3 Nov 2022 10:00:55 -0600 Subject: [PATCH] Updated to fetch the current PR branch --- diff-sha.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/diff-sha.sh b/diff-sha.sh index d7e396aa..31559568 100644 --- a/diff-sha.sh +++ b/diff-sha.sh @@ -135,7 +135,7 @@ else if [[ -z $INPUT_BASE_SHA ]]; then git fetch --no-tags -u --progress --depth="$INPUT_FETCH_DEPTH" origin "$TARGET_BRANCH":"$TARGET_BRANCH" - git fetch --no-tags -u --progress origin "$CURRENT_BRANCH":"$CURRENT_BRANCH" + git fetch --no-tags -u --progress origin "$CURRENT_BRANCH":"$GITHUB_HEAD_REF" PREVIOUS_SHA=$(git rev-list --no-merges -n 1 "$TARGET_BRANCH" 2>&1) && exit_status=$? || exit_status=$? if [[ -z "$PREVIOUS_SHA" ]]; then @@ -144,7 +144,7 @@ else echo "::debug::Previous SHA: $PREVIOUS_SHA" else git fetch --no-tags -u --progress --depth="$INPUT_FETCH_DEPTH" origin "$INPUT_BASE_SHA" && exit_status=$? || exit_status=$? - git fetch --no-tags -u --progress origin "$CURRENT_BRANCH":"$CURRENT_BRANCH" + git fetch --no-tags -u --progress origin "$CURRENT_BRANCH":"$GITHUB_HEAD_REF" PREVIOUS_SHA=$INPUT_BASE_SHA && exit_status=$? || exit_status=$? fi