mirror of
https://github.com/tj-actions/changed-files
synced 2025-03-05 21:06:25 +00:00
Update diff-sha.sh
This commit is contained in:
parent
3f045143ec
commit
ae2404f72e
1 changed files with 3 additions and 8 deletions
11
diff-sha.sh
11
diff-sha.sh
|
@ -193,7 +193,6 @@ else
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
echo "::debug::Current SHA: $CURRENT_SHA"
|
echo "::debug::Current SHA: $CURRENT_SHA"
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -z $INPUT_BASE_SHA ]]; then
|
if [[ -z $INPUT_BASE_SHA ]]; then
|
||||||
if [[ "$INPUT_SINCE_LAST_REMOTE_COMMIT" == "true" ]]; then
|
if [[ "$INPUT_SINCE_LAST_REMOTE_COMMIT" == "true" ]]; then
|
||||||
|
@ -204,14 +203,10 @@ else
|
||||||
PREVIOUS_SHA=$(git rev-parse origin/"$CURRENT_BRANCH" 2>&1) && exit_status=$? || exit_status=$?
|
PREVIOUS_SHA=$(git rev-parse origin/"$CURRENT_BRANCH" 2>&1) && exit_status=$? || exit_status=$?
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
PREVIOUS_SHA=$(git merge-base "$TARGET_BRANCH" "$CURRENT_SHA" 2>&1) && exit_status=$? || exit_status=$?
|
PREVIOUS_SHA=$GITHUB_EVENT_PULL_REQUEST_BASE_SHA
|
||||||
|
|
||||||
if [[ -z "$PREVIOUS_SHA" ]]; then
|
|
||||||
PREVIOUS_SHA=$GITHUB_EVENT_PULL_REQUEST_BASE_SHA && exit_status=$? || exit_status=$?
|
|
||||||
fi
|
|
||||||
|
|
||||||
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
|
||||||
PREVIOUS_SHA=$(git rev-parse origin/"$TARGET_BRANCH" 2>&1) && exit_status=$? || exit_status=$?
|
PREVIOUS_SHA=$(git merge-base "$PREVIOUS_SHA" "$CURRENT_SHA" 2>&1) && exit_status=$? || exit_status=$?
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -224,7 +219,7 @@ else
|
||||||
depth=$INPUT_FETCH_DEPTH
|
depth=$INPUT_FETCH_DEPTH
|
||||||
max_depth=$INPUT_MAX_FETCH_DEPTH
|
max_depth=$INPUT_MAX_FETCH_DEPTH
|
||||||
|
|
||||||
while ! git diff --name-only --ignore-submodules=all "$PREVIOUS_SHA"..."$CURRENT_SHA" 1>/dev/null 2>&1; do
|
while ! git diff --name-only --ignore-submodules=all "$PREVIOUS_SHA$DIFF$CURRENT_SHA" 1>/dev/null 2>&1; do
|
||||||
echo "Fetching $depth commits..."
|
echo "Fetching $depth commits..."
|
||||||
|
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
|
|
Loading…
Add table
Reference in a new issue