fix: fail when the merge base is not found (#879)

This commit is contained in:
Tonye Jack 2022-12-16 14:28:40 -07:00 committed by GitHub
parent 4f1ac0562f
commit b75f6c0571
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -270,12 +270,12 @@ else
# shellcheck disable=SC2086
git fetch $EXTRA_ARGS -u --progress --deepen="$i" origin $TARGET_BRANCH $CURRENT_SHA 1>/dev/null 2>&1
done
if ((i > max_depth)); then
echo "::error::Unable to locate a common ancestor between $TARGET_BRANCH and $CURRENT_BRANCH with: $PREVIOUS_SHA$DIFF$CURRENT_SHA"
exit 1
fi
done
else
echo "::debug::Not a shallow clone, skipping merge-base check."
fi