3
0
Fork 0
mirror of https://github.com/tj-actions/changed-files synced 2025-01-18 03:57:42 +00:00

Update diff-sha.sh

This commit is contained in:
Tonye Jack 2023-01-18 17:42:26 -07:00 committed by GitHub
parent 82b26d6c01
commit ddc065bac8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -158,6 +158,13 @@ else
echo "Fetching remote refs..." echo "Fetching remote refs..."
# shellcheck disable=SC2086 # shellcheck disable=SC2086
git fetch $EXTRA_ARGS -u --progress --deepen="$INPUT_FETCH_DEPTH" origin "$CURRENT_BRANCH" 1>/dev/null git fetch $EXTRA_ARGS -u --progress --deepen="$INPUT_FETCH_DEPTH" origin "$CURRENT_BRANCH" 1>/dev/null
if [[ "$INPUT_SINCE_LAST_REMOTE_COMMIT" != "true" ]]; then
echo "::debug::Fetching remote target branch..."
# shellcheck disable=SC2086
git fetch -u --progress $EXTRA_ARGS --depth="$INPUT_FETCH_DEPTH" origin +refs/heads/"$TARGET_BRANCH":refs/remotes/origin/"$TARGET_BRANCH" 1>/dev/null
git branch --track "$TARGET_BRANCH" origin/"$TARGET_BRANCH" 1>/dev/null 2>&1 || true
fi
fi fi
echo "::debug::Getting HEAD SHA..." echo "::debug::Getting HEAD SHA..."
@ -196,14 +203,6 @@ else
PREVIOUS_SHA=$GITHUB_EVENT_PULL_REQUEST_BASE_SHA PREVIOUS_SHA=$GITHUB_EVENT_PULL_REQUEST_BASE_SHA
fi fi
else else
if [[ -f .git/shallow ]]; then
echo "::debug::Fetching remote target branch..."
# shellcheck disable=SC2086
git fetch -u --progress $EXTRA_ARGS --depth="$INPUT_FETCH_DEPTH" origin +refs/heads/"$TARGET_BRANCH":refs/remotes/origin/"$TARGET_BRANCH" 1>/dev/null
fi
git branch --track "$TARGET_BRANCH" origin/"$TARGET_BRANCH" 1>/dev/null 2>&1 || true
PREVIOUS_SHA=$(git merge-base "$TARGET_BRANCH" "$CURRENT_SHA") && exit_status=$? || exit_status=$? PREVIOUS_SHA=$(git merge-base "$TARGET_BRANCH" "$CURRENT_SHA") && exit_status=$? || exit_status=$?
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