mirror of
https://github.com/tj-actions/changed-files
synced 2025-02-05 23:41:23 +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 fetch --depth="$INPUT_FETCH_DEPTH" origin +refs/heads/"$TARGET_BRANCH":refs/remotes/origin/"$TARGET_BRANCH"
|
||||||
git branch --track "$TARGET_BRANCH" origin/"$TARGET_BRANCH" || true
|
git branch --track "$TARGET_BRANCH" origin/"$TARGET_BRANCH" || true
|
||||||
|
|
||||||
|
depth=$INPUT_FETCH_DEPTH
|
||||||
|
|
||||||
while [ -z "$( git merge-base "$TARGET_BRANCH" HEAD )" ]; do
|
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
|
done
|
||||||
|
|
||||||
echo "::debug::Getting HEAD SHA..."
|
echo "::debug::Getting HEAD SHA..."
|
||||||
|
|
Loading…
Add table
Reference in a new issue