From a699a3be4a68a8727496e823c08b6d8760c23ab4 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Mon, 5 Dec 2022 00:02:56 -0700 Subject: [PATCH 1/2] Fixed test --- diff-sha.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/diff-sha.sh b/diff-sha.sh index 7dba02fd..ea00ba8d 100644 --- a/diff-sha.sh +++ b/diff-sha.sh @@ -226,7 +226,7 @@ else # shellcheck disable=SC2086 git fetch $EXTRA_ARGS -u --progress --deepen="$depth" origin +"$GITHUB_REF":refs/remotes/origin/"$CURRENT_BRANCH" - PREVIOUS_SHA=$(git merge-base origin/"$TARGET_BRANCH" "$CURRENT_SHA" 2>&1) + PREVIOUS_SHA=$(git merge-base origin/"$TARGET_BRANCH" "$CURRENT_SHA" 2>&1) && exit_status=$? || exit_status=$? if [[ $depth -gt $max_depth ]]; then echo "::error::Unable to locate a common ancestor between $TARGET_BRANCH and $CURRENT_SHA" From 477b3805799bb3f730bede86285a0362c52b87cf Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Mon, 5 Dec 2022 00:05:01 -0700 Subject: [PATCH 2/2] Updated to use git diff --- diff-sha.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/diff-sha.sh b/diff-sha.sh index ea00ba8d..78acf662 100644 --- a/diff-sha.sh +++ b/diff-sha.sh @@ -220,7 +220,7 @@ else depth=$INPUT_FETCH_DEPTH max_depth=$INPUT_MAX_FETCH_DEPTH - while ! git merge-base "$PREVIOUS_SHA" "$CURRENT_SHA" 1>/dev/null; do + while ! git diff --name-only --ignore-submodules=all "$PREVIOUS_SHA"..."$CURRENT_SHA"; do echo "Fetching $depth commits..." # shellcheck disable=SC2086