From d819b2b371fc5230c79fd08207c4c3f45218e3b1 Mon Sep 17 00:00:00 2001 From: Atsushi Watanabe Date: Fri, 23 Oct 2020 15:22:58 +0900 Subject: [PATCH] Fix diff command form (#46) Previous version took diff between index and worktree. This commit fixes it to compare two branches. --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 1f20b5b..119acf1 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -34,7 +34,7 @@ if [ "$(git rev-parse --revs-only "$SOURCE_BRANCH")" = "$(git rev-parse --revs-o fi # Do not proceed if there are no file differences, this avoids PRs with just a merge commit and no content -LINES_CHANGED=$(git diff --name-only -- "$DESTINATION_BRANCH" "$SOURCE_BRANCH" | wc -l | awk '{print $1}') +LINES_CHANGED=$(git diff --name-only "$DESTINATION_BRANCH" "$SOURCE_BRANCH" -- | wc -l | awk '{print $1}') if [[ "$LINES_CHANGED" = "0" ]] && [[ ! "$INPUT_PR_ALLOW_EMPTY" == "true" ]]; then echo "No file changes detected between source and destination branches." exit 0