diff --git a/diff-sha.sh b/diff-sha.sh index 4821d106..ae65e35e 100644 --- a/diff-sha.sh +++ b/diff-sha.sh @@ -224,10 +224,10 @@ else if [[ "$INPUT_SINCE_LAST_REMOTE_COMMIT" == "true" ]]; then PREVIOUS_SHA=$GITHUB_EVENT_BEFORE else - PREVIOUS_SHA=$GITHUB_EVENT_PULL_REQUEST_BASE_SHA - + PREVIOUS_SHA=$(git merge-base --fork-point "$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 - PREVIOUS_SHA=$(git merge-base --fork-point "$TARGET_BRANCH" "$CURRENT_SHA") && exit_status=$? || exit_status=$? + PREVIOUS_SHA=$GITHUB_EVENT_PULL_REQUEST_BASE_SHA fi fi