From 042d993a61acc46a3f00cbfd633f2020036dc052 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Thu, 5 Jan 2023 08:12:42 -0700 Subject: [PATCH 1/4] fix(regression): invalid json output for changed files within a directory --- test/test/test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test/test.txt b/test/test/test.txt index 9f4b6d8bfea..6de7b8c69d6 100644 --- a/test/test/test.txt +++ b/test/test/test.txt @@ -1 +1 @@ -This is a test file +This is a test file. From 74baaccbb4f1bcaf91ff8185645bb21fad7e4b4f Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Thu, 5 Jan 2023 08:18:24 -0700 Subject: [PATCH 2/4] Update test.yml --- .github/workflows/test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2ccb41dc356..3695c586632 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,7 +3,6 @@ name: CI on: push: branches: - - main - "**" pull_request: types: From f73938419c06d0edea8eb83eb12cea98c076f03f Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Thu, 5 Jan 2023 08:21:23 -0700 Subject: [PATCH 3/4] Update get-changed-paths.sh --- get-changed-paths.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/get-changed-paths.sh b/get-changed-paths.sh index 38a1972bacd..b8f1c8f8b15 100755 --- a/get-changed-paths.sh +++ b/get-changed-paths.sh @@ -58,7 +58,7 @@ function json_output() { fi # shellcheck disable=SC2086 - jq $JQ_ARGS 'split("\n") | @json' | tr -s / + jq $JQ_ARGS 'split("\n") | @json' | sed -r 's/^"|"$//g' | tr -s / } function get_diff() { From f939c4156fb89196f2efa380e52b17d2a1c9f8f2 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Thu, 5 Jan 2023 10:09:10 -0700 Subject: [PATCH 4/4] Fixed json_output function --- get-changed-paths.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/get-changed-paths.sh b/get-changed-paths.sh index b8f1c8f8b15..224d050f9e0 100755 --- a/get-changed-paths.sh +++ b/get-changed-paths.sh @@ -52,13 +52,13 @@ function get_dirname_max_depth() { } function json_output() { - JQ_ARGS="-R" + JQ_ARGS="-sR" if [[ "$INPUT_JSON_RAW_FORMAT" == "true" ]]; then JQ_ARGS="$JQ_ARGS -r" fi # shellcheck disable=SC2086 - jq $JQ_ARGS 'split("\n") | @json' | sed -r 's/^"|"$//g' | tr -s / + jq $JQ_ARGS 'split("\n") | map(select(. != "")) | @json' | sed -r 's/^"|"$//g' | tr -s / } function get_diff() {