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:
parent
ece8e1f566
commit
5b43f91839
1 changed files with 9 additions and 1 deletions
10
diff-sha.sh
10
diff-sha.sh
|
@ -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..."
|
||||
|
|
Loading…
Reference in a new issue