3
0
Fork 0
mirror of https://github.com/tj-actions/changed-files synced 2024-12-17 13:47:20 +00:00

Update diff-sha.sh

This commit is contained in:
Tonye Jack 2022-12-12 11:14:49 -07:00 committed by GitHub
parent 17ae17127c
commit 8fb90ed7f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -205,6 +205,10 @@ else
fi fi
else else
PREVIOUS_SHA=$GITHUB_EVENT_PULL_REQUEST_BASE_SHA PREVIOUS_SHA=$GITHUB_EVENT_PULL_REQUEST_BASE_SHA
if ! git diff --name-only --ignore-submodules=all "$PREVIOUS_SHA$DIFF$CURRENT_SHA" 1>/dev/null 2>&1; then
PREVIOUS_SHA=$(git merge-base "$PREVIOUS_SHA" "$CURRENT_SHA" 2>&1) && exit_status=$? || exit_status=$?
fi
fi fi
if [[ -z "$PREVIOUS_SHA" || "$PREVIOUS_SHA" == "$CURRENT_SHA" ]]; then if [[ -z "$PREVIOUS_SHA" || "$PREVIOUS_SHA" == "$CURRENT_SHA" ]]; then
@ -217,10 +221,10 @@ else
max_depth=$INPUT_MAX_FETCH_DEPTH max_depth=$INPUT_MAX_FETCH_DEPTH
for ((i=0; i<max_depth; i+=depth)); do for ((i=0; i<max_depth; i+=depth)); do
echo "Fetching $depth commits..." echo "Fetching $i commits..."
# shellcheck disable=SC2086 # shellcheck disable=SC2086
git fetch $EXTRA_ARGS -u --progress --deepen="$depth" origin "$CURRENT_BRANCH" git fetch $EXTRA_ARGS -u --progress --deepen="$i" origin "$CURRENT_BRANCH"
if git diff --name-only --ignore-submodules=all "$PREVIOUS_SHA$DIFF$CURRENT_SHA" 1>/dev/null 2>&1; then if git diff --name-only --ignore-submodules=all "$PREVIOUS_SHA$DIFF$CURRENT_SHA" 1>/dev/null 2>&1; then
break break