3
0
Fork 0
mirror of https://github.com/tj-actions/changed-files synced 2025-01-29 03:34:50 +00:00

Update diff-sha.sh

This commit is contained in:
Tonye Jack 2022-11-04 16:31:48 -06:00 committed by GitHub
parent ece8e1f566
commit 5b43f91839
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -137,8 +137,16 @@ else
git fetch --depth="$INPUT_FETCH_DEPTH" origin +refs/heads/"$TARGET_BRANCH":refs/remotes/origin/"$TARGET_BRANCH"
git branch --track "$TARGET_BRANCH" origin/"$TARGET_BRANCH" || true
depth=$INPUT_FETCH_DEPTH
while [ -z "$( git merge-base "$TARGET_BRANCH" HEAD )" ]; do
git fetch --deepen="$INPUT_FETCH_DEPTH" origin "$TARGET_BRANCH" HEAD;
git fetch --deepen="$depth" origin "$TARGET_BRANCH" HEAD;
depth=$((depth * 10))
max_depth=3000
if [[ $depth -gt $max_depth ]]; then
echo "::error::Unable to find merge-base of $TARGET_BRANCH and HEAD."
fi
done
echo "::debug::Getting HEAD SHA..."