mirror of
https://github.com/tj-actions/changed-files
synced 2024-12-16 19:27:39 +00:00
Update diff-sha.sh
This commit is contained in:
parent
fbc9b61579
commit
0707f1b441
1 changed files with 6 additions and 1 deletions
|
@ -7,11 +7,16 @@ GITHUB_OUTPUT=${GITHUB_OUTPUT:-""}
|
|||
EXTRA_ARGS="--no-tags"
|
||||
PREVIOUS_SHA=""
|
||||
CURRENT_SHA=""
|
||||
DIFF="..."
|
||||
|
||||
if [[ "$GITHUB_REF" == "refs/tags/"* ]]; then
|
||||
EXTRA_ARGS=""
|
||||
fi
|
||||
|
||||
if [[ "$GITHUB_EVENT_HEAD_REPO_FORK" == "true" ]]; then
|
||||
DIFF=".."
|
||||
fi
|
||||
|
||||
echo "::group::changed-files-diff-sha"
|
||||
|
||||
if [[ -n $INPUT_PATH ]]; then
|
||||
|
@ -205,7 +210,7 @@ else
|
|||
PREVIOUS_SHA=$GITHUB_EVENT_PULL_REQUEST_BASE_SHA && exit_status=$? || exit_status=$?
|
||||
fi
|
||||
|
||||
if ! git diff --name-only --ignore-submodules=all "$PREVIOUS_SHA"..."$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=$?
|
||||
fi
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue