From adde7bbfea8fcba97d0f3d97ad57187a9f16dbbc Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Mon, 13 Feb 2023 21:01:50 -0700 Subject: [PATCH 01/26] chore: update submodule --- test/demo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/demo b/test/demo index 3b8549eb..83ccca9b 160000 --- a/test/demo +++ b/test/demo @@ -1 +1 @@ -Subproject commit 3b8549eb19fb6d4ff2017cbe27d2cec353cace93 +Subproject commit 83ccca9b633cc41dc1f04e690e4a3a8026a01359 From a4b2b85206a18f8aeac071e36a9fa8ed98e5b99a Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Mon, 13 Feb 2023 21:21:43 -0700 Subject: [PATCH 02/26] Updated the test --- .github/workflows/test.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9e252e6d..3abdd244 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -334,6 +334,34 @@ jobs: echo "Expected: (failure) got ${{ steps.changed-files-specific.outcome }}" exit 1 + test-submodules: + name: Test changed-files with submodule + runs-on: ${{ matrix.platform }} + strategy: + fail-fast: false + max-parallel: 4 + matrix: + platform: [ubuntu-latest] + + steps: + - name: Checkout to branch + uses: actions/checkout@v3 + with: + submodules: true + + - name: Run changed-files with submodule + id: changed-files + uses: ./ + with: + base_sha: "85bd869" + sha: "adde7bb" + + - name: Show output + run: | + echo "${{ toJSON(steps.changed-files.outputs) }}" + shell: + bash + test: name: Test changed-files runs-on: ${{ matrix.platform }} From 608b7f81dec8b4260a1d40179086c9d033542829 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Mon, 13 Feb 2023 21:23:31 -0700 Subject: [PATCH 03/26] Enable debugging. --- diff-sha.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/diff-sha.sh b/diff-sha.sh index 896e0515..747e9889 100644 --- a/diff-sha.sh +++ b/diff-sha.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -set -euo pipefail +set -euxo pipefail INITIAL_COMMIT="false" GITHUB_OUTPUT=${GITHUB_OUTPUT:-""} From 68f10de3ead55c05465e5cdc8c0452c8d5d4afba Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Mon, 13 Feb 2023 21:28:45 -0700 Subject: [PATCH 04/26] Enable debugging. --- 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 5cf7fd2f..edc8df1f 100755 --- a/get-changed-paths.sh +++ b/get-changed-paths.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -set -euo pipefail +set -euxo pipefail INPUT_SEPARATOR="${INPUT_SEPARATOR//'%'/'%25'}" INPUT_SEPARATOR="${INPUT_SEPARATOR//'.'/'%2E'}" From f0fc230482b82d4049c4ba52c6aa1ef0cf22ea6a Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Tue, 14 Feb 2023 04:14:01 -0700 Subject: [PATCH 05/26] Update get-changed-paths.sh --- get-changed-paths.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/get-changed-paths.sh b/get-changed-paths.sh index edc8df1f..480a5ab4 100755 --- a/get-changed-paths.sh +++ b/get-changed-paths.sh @@ -71,13 +71,13 @@ function get_diff() { local filter="$3" while IFS='' read -r sub; do - sub_commit_pre="$(git diff "$base$DIFF$sha" -- "$sub" | { grep '^[-]Subproject commit' || true; } | awk '{print $3}')" && exit_status=$? || exit_status=$? + sub_commit_pre="$(git diff "$base" "$sha" -- "$sub" | { grep '^[-]Subproject commit' || true; } | awk '{print $3}')" && exit_status=$? || exit_status=$? if [[ $exit_status -ne 0 ]]; then echo "::error::Failed to get previous commit for submodule ($sub) between: $base$DIFF$sha" exit 1 fi - sub_commit_cur="$(git diff "$base$DIFF$sha" -- "$sub" | { grep '^[+]Subproject commit' || true; } | awk '{print $3}')" && exit_status=$? || exit_status=$? + sub_commit_cur="$(git diff "$base" "$sha" -- "$sub" | { grep '^[+]Subproject commit' || true; } | awk '{print $3}')" && exit_status=$? || exit_status=$? if [[ $exit_status -ne 0 ]]; then echo "::error::Failed to get current commit for submodule ($sub) between: $base$DIFF$sha" exit 1 @@ -106,13 +106,13 @@ function get_renames() { local sha="$2" while IFS='' read -r sub; do - sub_commit_pre="$(git diff "$base$DIFF$sha" -- "$sub" | { grep '^[-]Subproject commit' || true; } | awk '{print $3}')" && exit_status=$? || exit_status=$? + sub_commit_pre="$(git diff "$base" "$sha" -- "$sub" | { grep '^[-]Subproject commit' || true; } | awk '{print $3}')" && exit_status=$? || exit_status=$? if [[ $exit_status -ne 0 ]]; then echo "::error::Failed to get previous commit for submodule ($sub) between: $base$DIFF$sha" exit 1 fi - sub_commit_cur="$(git diff "$base$DIFF$sha" -- "$sub" | { grep '^[+]Subproject commit' || true; } | awk '{print $3}')" && exit_status=$? || exit_status=$? + sub_commit_cur="$(git diff "$base" "$sha" -- "$sub" | { grep '^[+]Subproject commit' || true; } | awk '{print $3}')" && exit_status=$? || exit_status=$? if [[ $exit_status -ne 0 ]]; then echo "::error::Failed to get current commit for submodule ($sub) between: $base$DIFF$sha" exit 1 From 4dc0f1f9049fda16689fda0375afcc1c0eea241f Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Tue, 14 Feb 2023 04:41:11 -0700 Subject: [PATCH 06/26] Update get-changed-paths.sh --- get-changed-paths.sh | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/get-changed-paths.sh b/get-changed-paths.sh index 480a5ab4..9d00965e 100755 --- a/get-changed-paths.sh +++ b/get-changed-paths.sh @@ -69,35 +69,36 @@ function get_diff() { local base="$1" local sha="$2" local filter="$3" + local diff="${DIFF:-4}" while IFS='' read -r sub; do sub_commit_pre="$(git diff "$base" "$sha" -- "$sub" | { grep '^[-]Subproject commit' || true; } | awk '{print $3}')" && exit_status=$? || exit_status=$? if [[ $exit_status -ne 0 ]]; then echo "::error::Failed to get previous commit for submodule ($sub) between: $base$DIFF$sha" - exit 1 + return 1 fi sub_commit_cur="$(git diff "$base" "$sha" -- "$sub" | { grep '^[+]Subproject commit' || true; } | awk '{print $3}')" && exit_status=$? || exit_status=$? if [[ $exit_status -ne 0 ]]; then - echo "::error::Failed to get current commit for submodule ($sub) between: $base$DIFF$sha" - exit 1 + echo "::error::Failed to get current commit for submodule ($sub) between: $base $sha" + return 1 fi if [ -n "$sub_commit_cur" ]; then ( cd "$sub" && ( # the strange magic number is a hardcoded "empty tree" commit sha - get_diff "${sub_commit_pre:-4b825dc642cb6eb9a060e54bf8d69288fbee4904}" "${sub_commit_cur}" "$filter" | awk -v r="$sub" '{ print "" r "/" $0}' + get_diff "${sub_commit_pre:-4b825dc642cb6eb9a060e54bf8d69288fbee4904}" "${sub_commit_cur}" "$filter" ".." | awk -v r="$sub" '{ print "" r "/" $0}' ) ) fi done < <(git submodule | awk '{print $2}') - git diff --diff-filter="$filter" --name-only --ignore-submodules=all --no-merges "$base$DIFF$sha" && exit_status=$? || exit_status=$? + git diff --diff-filter="$filter" --name-only --ignore-submodules=all "$base$diff$sha" && exit_status=$? || exit_status=$? if [[ $exit_status -ne 0 ]]; then echo "::error::Failed to get changed files between: $base$DIFF$sha" - exit 1 + return 1 fi } @@ -109,13 +110,13 @@ function get_renames() { sub_commit_pre="$(git diff "$base" "$sha" -- "$sub" | { grep '^[-]Subproject commit' || true; } | awk '{print $3}')" && exit_status=$? || exit_status=$? if [[ $exit_status -ne 0 ]]; then echo "::error::Failed to get previous commit for submodule ($sub) between: $base$DIFF$sha" - exit 1 + return 1 fi sub_commit_cur="$(git diff "$base" "$sha" -- "$sub" | { grep '^[+]Subproject commit' || true; } | awk '{print $3}')" && exit_status=$? || exit_status=$? if [[ $exit_status -ne 0 ]]; then echo "::error::Failed to get current commit for submodule ($sub) between: $base$DIFF$sha" - exit 1 + return 1 fi if [ -n "$sub_commit_cur" ]; then @@ -132,7 +133,7 @@ function get_renames() { if [[ $exit_status -ne 0 ]]; then echo "::error::Failed to get renamed files between: $base → $sha" - exit 1 + return 1 fi } From 6164e1cd7fdc6c8a5a406de58b24eda22444e4ea Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Tue, 14 Feb 2023 04:45:30 -0700 Subject: [PATCH 07/26] 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 9d00965e..9d76745b 100755 --- a/get-changed-paths.sh +++ b/get-changed-paths.sh @@ -69,7 +69,7 @@ function get_diff() { local base="$1" local sha="$2" local filter="$3" - local diff="${DIFF:-4}" + local diff="${4:-$DIFF}" while IFS='' read -r sub; do sub_commit_pre="$(git diff "$base" "$sha" -- "$sub" | { grep '^[-]Subproject commit' || true; } | awk '{print $3}')" && exit_status=$? || exit_status=$? From 5e8b123b3d8e3945ee345e183cbfe1dcf2c5b3da Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Wed, 15 Feb 2023 15:50:34 -0700 Subject: [PATCH 08/26] Updated get_diff --- get-changed-paths.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/get-changed-paths.sh b/get-changed-paths.sh index 9d76745b..f6666158 100755 --- a/get-changed-paths.sh +++ b/get-changed-paths.sh @@ -69,12 +69,11 @@ function get_diff() { local base="$1" local sha="$2" local filter="$3" - local diff="${4:-$DIFF}" while IFS='' read -r sub; do sub_commit_pre="$(git diff "$base" "$sha" -- "$sub" | { grep '^[-]Subproject commit' || true; } | awk '{print $3}')" && exit_status=$? || exit_status=$? if [[ $exit_status -ne 0 ]]; then - echo "::error::Failed to get previous commit for submodule ($sub) between: $base$DIFF$sha" + echo "::error::Failed to get previous commit for submodule ($sub) between: $base $sha" return 1 fi @@ -88,13 +87,13 @@ function get_diff() { ( cd "$sub" && ( # the strange magic number is a hardcoded "empty tree" commit sha - get_diff "${sub_commit_pre:-4b825dc642cb6eb9a060e54bf8d69288fbee4904}" "${sub_commit_cur}" "$filter" ".." | awk -v r="$sub" '{ print "" r "/" $0}' + git diff --diff-filter="$filter" --name-only --ignore-submodules=all "${sub_commit_pre:-4b825dc642cb6eb9a060e54bf8d69288fbee4904}" "${sub_commit_cur}" | awk -v r="$sub" '{ print "" r "/" $0}' ) ) fi done < <(git submodule | awk '{print $2}') - git diff --diff-filter="$filter" --name-only --ignore-submodules=all "$base$diff$sha" && exit_status=$? || exit_status=$? + git diff --diff-filter="$filter" --name-only --ignore-submodules=all "$base$DIFF$sha" && exit_status=$? || exit_status=$? if [[ $exit_status -ne 0 ]]; then echo "::error::Failed to get changed files between: $base$DIFF$sha" From 65a49b917fba517f7bf1484045ef15abdee868d6 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Wed, 15 Feb 2023 16:54:30 -0700 Subject: [PATCH 09/26] Update error message --- get-changed-paths.sh | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/get-changed-paths.sh b/get-changed-paths.sh index f6666158..d4f1980c 100755 --- a/get-changed-paths.sh +++ b/get-changed-paths.sh @@ -56,13 +56,13 @@ function get_dirname_max_depth() { } function json_output() { - JQ_ARGS="-sR" + local jq_args="-sR" if [[ "$INPUT_JSON_RAW_FORMAT" == "true" ]]; then - JQ_ARGS="$JQ_ARGS -r" + jq_args="$jq_args -r" fi # shellcheck disable=SC2086 - jq $JQ_ARGS 'split("\n") | map(select(. != "")) | @json' | sed -r 's/^"|"$//g' | tr -s / + jq $jq_args 'split("\n") | map(select(. != "")) | @json' | sed -r 's/^"|"$//g' | tr -s / } function get_diff() { @@ -73,21 +73,21 @@ function get_diff() { while IFS='' read -r sub; do sub_commit_pre="$(git diff "$base" "$sha" -- "$sub" | { grep '^[-]Subproject commit' || true; } | awk '{print $3}')" && exit_status=$? || exit_status=$? if [[ $exit_status -ne 0 ]]; then - echo "::error::Failed to get previous commit for submodule ($sub) between: $base $sha" - return 1 + echo "::warning::Failed to get previous commit for submodule ($sub) between: $base $sha. Please ensure that submodules are initialized and up to date. See: https://github.com/actions/checkout#usage" >&2 + return 0 fi sub_commit_cur="$(git diff "$base" "$sha" -- "$sub" | { grep '^[+]Subproject commit' || true; } | awk '{print $3}')" && exit_status=$? || exit_status=$? if [[ $exit_status -ne 0 ]]; then - echo "::error::Failed to get current commit for submodule ($sub) between: $base $sha" - return 1 + echo "::warning::Failed to get current commit for submodule ($sub) between: $base $sha. Please ensure that submodules are initialized and up to date. See: https://github.com/actions/checkout#usage" >&2 + return 0 fi if [ -n "$sub_commit_cur" ]; then ( cd "$sub" && ( # the strange magic number is a hardcoded "empty tree" commit sha - git diff --diff-filter="$filter" --name-only --ignore-submodules=all "${sub_commit_pre:-4b825dc642cb6eb9a060e54bf8d69288fbee4904}" "${sub_commit_cur}" | awk -v r="$sub" '{ print "" r "/" $0}' + git diff --diff-filter="$filter" --name-only --ignore-submodules=all "${sub_commit_pre:-4b825dc642cb6eb9a060e54bf8d69288fbee4904}" "${sub_commit_cur}" | awk -v r="$sub" '{ print "" r "/" $0}' 2>/dev/null ) ) fi @@ -96,7 +96,7 @@ function get_diff() { git diff --diff-filter="$filter" --name-only --ignore-submodules=all "$base$DIFF$sha" && exit_status=$? || exit_status=$? if [[ $exit_status -ne 0 ]]; then - echo "::error::Failed to get changed files between: $base$DIFF$sha" + echo "::error::Failed to get changed files between: $base$DIFF$sha" >&2 return 1 fi } @@ -108,21 +108,21 @@ function get_renames() { while IFS='' read -r sub; do sub_commit_pre="$(git diff "$base" "$sha" -- "$sub" | { grep '^[-]Subproject commit' || true; } | awk '{print $3}')" && exit_status=$? || exit_status=$? if [[ $exit_status -ne 0 ]]; then - echo "::error::Failed to get previous commit for submodule ($sub) between: $base$DIFF$sha" - return 1 + echo "::error::Failed to get previous commit for submodule ($sub) between: $base $sha. Please ensure that submodules are initialized and up to date. See: https://github.com/actions/checkout#usage" >&2 + return 0 fi sub_commit_cur="$(git diff "$base" "$sha" -- "$sub" | { grep '^[+]Subproject commit' || true; } | awk '{print $3}')" && exit_status=$? || exit_status=$? if [[ $exit_status -ne 0 ]]; then - echo "::error::Failed to get current commit for submodule ($sub) between: $base$DIFF$sha" - return 1 + echo "::error::Failed to get current commit for submodule ($sub) between: $base $sha. Please ensure that submodules are initialized and up to date. See: https://github.com/actions/checkout#usage" >&2 + return 0 fi if [ -n "$sub_commit_cur" ]; then ( cd "$sub" && ( # the strange magic number is a hardcoded "empty tree" commit sha - get_renames "${sub_commit_pre:-4b825dc642cb6eb9a060e54bf8d69288fbee4904}" "${sub_commit_cur}" | awk -v r="$sub" '{ print "" r "/" $0}' + git log --name-status --ignore-submodules=all "${sub_commit_pre:-4b825dc642cb6eb9a060e54bf8d69288fbee4904}" "${sub_commit_cur}" | { grep -E "^R" || true; } | awk -F '\t' -v d="$INPUT_OLD_NEW_SEPARATOR" '{print $2d$3}' | awk -v r="$sub" '{ print "" r "/" $0}' ) ) fi @@ -131,7 +131,7 @@ function get_renames() { git log --name-status --ignore-submodules=all "$base" "$sha" | { grep -E "^R" || true; } | awk -F '\t' -v d="$INPUT_OLD_NEW_SEPARATOR" '{print $2d$3}' && exit_status=$? || exit_status=$? if [[ $exit_status -ne 0 ]]; then - echo "::error::Failed to get renamed files between: $base → $sha" + echo "::error::Failed to get renamed files between: $base → $sha" >&2 return 1 fi } From 73246a42b08dcaa22631ddbd794ad7adefc11e77 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Wed, 15 Feb 2023 17:04:39 -0700 Subject: [PATCH 10/26] Update error message --- get-changed-paths.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/get-changed-paths.sh b/get-changed-paths.sh index d4f1980c..eda9b0c7 100755 --- a/get-changed-paths.sh +++ b/get-changed-paths.sh @@ -89,7 +89,10 @@ function get_diff() { # the strange magic number is a hardcoded "empty tree" commit sha git diff --diff-filter="$filter" --name-only --ignore-submodules=all "${sub_commit_pre:-4b825dc642cb6eb9a060e54bf8d69288fbee4904}" "${sub_commit_cur}" | awk -v r="$sub" '{ print "" r "/" $0}' 2>/dev/null ) - ) + ) || { + echo "::error::Failed to get changed files for submodule ($sub) between: $base $sha. Please ensure that submodules are initialized and up to date. See: https://github.com/actions/checkout#usage" >&2 + return 0 + } fi done < <(git submodule | awk '{print $2}') @@ -124,7 +127,10 @@ function get_renames() { # the strange magic number is a hardcoded "empty tree" commit sha git log --name-status --ignore-submodules=all "${sub_commit_pre:-4b825dc642cb6eb9a060e54bf8d69288fbee4904}" "${sub_commit_cur}" | { grep -E "^R" || true; } | awk -F '\t' -v d="$INPUT_OLD_NEW_SEPARATOR" '{print $2d$3}' | awk -v r="$sub" '{ print "" r "/" $0}' ) - ) + ) || { + echo "::error::Failed to get renamed files for submodule ($sub) between: $base $sha. Please ensure that submodules are initialized and up to date. See: https://github.com/actions/checkout#usage" >&2 + return 0 + } fi done < <(git submodule | awk '{print $2}') From adb9fa830de45fadc1044819b684cfe36a1d90fc Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Wed, 15 Feb 2023 17:07:19 -0700 Subject: [PATCH 11/26] Update error message --- get-changed-paths.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/get-changed-paths.sh b/get-changed-paths.sh index eda9b0c7..200874d4 100755 --- a/get-changed-paths.sh +++ b/get-changed-paths.sh @@ -90,7 +90,7 @@ function get_diff() { git diff --diff-filter="$filter" --name-only --ignore-submodules=all "${sub_commit_pre:-4b825dc642cb6eb9a060e54bf8d69288fbee4904}" "${sub_commit_cur}" | awk -v r="$sub" '{ print "" r "/" $0}' 2>/dev/null ) ) || { - echo "::error::Failed to get changed files for submodule ($sub) between: $base $sha. Please ensure that submodules are initialized and up to date. See: https://github.com/actions/checkout#usage" >&2 + echo "::warning::Failed to get changed files for submodule ($sub) between: $base $sha. Please ensure that submodules are initialized and up to date. See: https://github.com/actions/checkout#usage" >&2 return 0 } fi @@ -111,13 +111,13 @@ function get_renames() { while IFS='' read -r sub; do sub_commit_pre="$(git diff "$base" "$sha" -- "$sub" | { grep '^[-]Subproject commit' || true; } | awk '{print $3}')" && exit_status=$? || exit_status=$? if [[ $exit_status -ne 0 ]]; then - echo "::error::Failed to get previous commit for submodule ($sub) between: $base $sha. Please ensure that submodules are initialized and up to date. See: https://github.com/actions/checkout#usage" >&2 + echo "::warning::Failed to get previous commit for submodule ($sub) between: $base $sha. Please ensure that submodules are initialized and up to date. See: https://github.com/actions/checkout#usage" >&2 return 0 fi sub_commit_cur="$(git diff "$base" "$sha" -- "$sub" | { grep '^[+]Subproject commit' || true; } | awk '{print $3}')" && exit_status=$? || exit_status=$? if [[ $exit_status -ne 0 ]]; then - echo "::error::Failed to get current commit for submodule ($sub) between: $base $sha. Please ensure that submodules are initialized and up to date. See: https://github.com/actions/checkout#usage" >&2 + echo "::warning::Failed to get current commit for submodule ($sub) between: $base $sha. Please ensure that submodules are initialized and up to date. See: https://github.com/actions/checkout#usage" >&2 return 0 fi @@ -128,7 +128,7 @@ function get_renames() { git log --name-status --ignore-submodules=all "${sub_commit_pre:-4b825dc642cb6eb9a060e54bf8d69288fbee4904}" "${sub_commit_cur}" | { grep -E "^R" || true; } | awk -F '\t' -v d="$INPUT_OLD_NEW_SEPARATOR" '{print $2d$3}' | awk -v r="$sub" '{ print "" r "/" $0}' ) ) || { - echo "::error::Failed to get renamed files for submodule ($sub) between: $base $sha. Please ensure that submodules are initialized and up to date. See: https://github.com/actions/checkout#usage" >&2 + echo "::warning::Failed to get renamed files for submodule ($sub) between: $base $sha. Please ensure that submodules are initialized and up to date. See: https://github.com/actions/checkout#usage" >&2 return 0 } fi From 4d6ed243ffe01796072af2c158c253c278f08cdd Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Wed, 15 Feb 2023 17:09:42 -0700 Subject: [PATCH 12/26] Update error message --- get-changed-paths.sh | 6 ------ 1 file changed, 6 deletions(-) diff --git a/get-changed-paths.sh b/get-changed-paths.sh index 200874d4..a82f65fc 100755 --- a/get-changed-paths.sh +++ b/get-changed-paths.sh @@ -74,13 +74,11 @@ function get_diff() { sub_commit_pre="$(git diff "$base" "$sha" -- "$sub" | { grep '^[-]Subproject commit' || true; } | awk '{print $3}')" && exit_status=$? || exit_status=$? if [[ $exit_status -ne 0 ]]; then echo "::warning::Failed to get previous commit for submodule ($sub) between: $base $sha. Please ensure that submodules are initialized and up to date. See: https://github.com/actions/checkout#usage" >&2 - return 0 fi sub_commit_cur="$(git diff "$base" "$sha" -- "$sub" | { grep '^[+]Subproject commit' || true; } | awk '{print $3}')" && exit_status=$? || exit_status=$? if [[ $exit_status -ne 0 ]]; then echo "::warning::Failed to get current commit for submodule ($sub) between: $base $sha. Please ensure that submodules are initialized and up to date. See: https://github.com/actions/checkout#usage" >&2 - return 0 fi if [ -n "$sub_commit_cur" ]; then @@ -91,7 +89,6 @@ function get_diff() { ) ) || { echo "::warning::Failed to get changed files for submodule ($sub) between: $base $sha. Please ensure that submodules are initialized and up to date. See: https://github.com/actions/checkout#usage" >&2 - return 0 } fi done < <(git submodule | awk '{print $2}') @@ -112,13 +109,11 @@ function get_renames() { sub_commit_pre="$(git diff "$base" "$sha" -- "$sub" | { grep '^[-]Subproject commit' || true; } | awk '{print $3}')" && exit_status=$? || exit_status=$? if [[ $exit_status -ne 0 ]]; then echo "::warning::Failed to get previous commit for submodule ($sub) between: $base $sha. Please ensure that submodules are initialized and up to date. See: https://github.com/actions/checkout#usage" >&2 - return 0 fi sub_commit_cur="$(git diff "$base" "$sha" -- "$sub" | { grep '^[+]Subproject commit' || true; } | awk '{print $3}')" && exit_status=$? || exit_status=$? if [[ $exit_status -ne 0 ]]; then echo "::warning::Failed to get current commit for submodule ($sub) between: $base $sha. Please ensure that submodules are initialized and up to date. See: https://github.com/actions/checkout#usage" >&2 - return 0 fi if [ -n "$sub_commit_cur" ]; then @@ -129,7 +124,6 @@ function get_renames() { ) ) || { echo "::warning::Failed to get renamed files for submodule ($sub) between: $base $sha. Please ensure that submodules are initialized and up to date. See: https://github.com/actions/checkout#usage" >&2 - return 0 } fi done < <(git submodule | awk '{print $2}') From 5982c926769189682df26961e3cc8e5b2aa0f82c Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Wed, 15 Feb 2023 17:22:35 -0700 Subject: [PATCH 13/26] Update to include submodules. --- diff-sha.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/diff-sha.sh b/diff-sha.sh index 3e3a81fc..f6f95910 100644 --- a/diff-sha.sh +++ b/diff-sha.sh @@ -4,7 +4,7 @@ set -euxo pipefail INITIAL_COMMIT="false" GITHUB_OUTPUT=${GITHUB_OUTPUT:-""} -EXTRA_ARGS="--no-tags --prune --no-recurse-submodules" +EXTRA_ARGS="--no-tags --prune --recurse-submodules" PREVIOUS_SHA="" CURRENT_SHA="" DIFF="..." @@ -12,7 +12,7 @@ IS_TAG="false" if [[ "$GITHUB_REF" == "refs/tags/"* ]]; then IS_TAG="true" - EXTRA_ARGS="--prune --no-recurse-submodules" + EXTRA_ARGS="--prune --recurse-submodules" fi if [[ -z $GITHUB_EVENT_PULL_REQUEST_BASE_REF || "$GITHUB_EVENT_HEAD_REPO_FORK" == "true" ]]; then @@ -218,7 +218,7 @@ else # Fetch more of the target branch history until the merge base is found for i in {1..10}; do # shellcheck disable=SC2086 - git fetch $EXTRA_ARGS -u --progress --deepen="$INPUT_FETCH_DEPTH" origin "$TARGET_BRANCH:$TARGET_BRANCH" 1>/dev/null + git fetch $EXTRA_ARGS -u --progress --deepen="$INPUT_FETCH_DEPTH" origin +refs/heads/"$TARGET_BRANCH":refs/remotes/origin/"$TARGET_BRANCH" 1>/dev/null if git merge-base "$PREVIOUS_SHA" "$CURRENT_SHA" 1>/dev/null 2>&1; then break fi From ab5069cbb13cd1967dee73c9d11ac7c1399b2663 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Wed, 15 Feb 2023 18:04:27 -0700 Subject: [PATCH 14/26] Remove debugging --- diff-sha.sh | 2 +- get-changed-paths.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/diff-sha.sh b/diff-sha.sh index f6f95910..469c7f10 100644 --- a/diff-sha.sh +++ b/diff-sha.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -set -euxo pipefail +set -euo pipefail INITIAL_COMMIT="false" GITHUB_OUTPUT=${GITHUB_OUTPUT:-""} diff --git a/get-changed-paths.sh b/get-changed-paths.sh index a82f65fc..3221c1be 100755 --- a/get-changed-paths.sh +++ b/get-changed-paths.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -set -euxo pipefail +set -euo pipefail INPUT_SEPARATOR="${INPUT_SEPARATOR//'%'/'%25'}" INPUT_SEPARATOR="${INPUT_SEPARATOR//'.'/'%2E'}" From 123da803957da82d321f696d85eec6286fa8a70e Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Wed, 15 Feb 2023 18:08:56 -0700 Subject: [PATCH 15/26] Updated the test --- .github/workflows/test.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3abdd244..22a646eb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -356,6 +356,12 @@ jobs: base_sha: "85bd869" sha: "adde7bb" + - name: Verify added files + if: steps.changed-files.outputs.added_files != 'test/demo/test/test.txt' + run: | + echo "Expected: (test/demo/test/test.txt) got ${{ steps.changed-files.outputs.added_files }}" + exit 1 + - name: Show output run: | echo "${{ toJSON(steps.changed-files.outputs) }}" From ab710fb168fc55bfac95911978c4784bf01f3575 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Wed, 15 Feb 2023 19:35:16 -0700 Subject: [PATCH 16/26] Fixed the test --- diff-sha.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/diff-sha.sh b/diff-sha.sh index 469c7f10..9798bfea 100644 --- a/diff-sha.sh +++ b/diff-sha.sh @@ -60,7 +60,8 @@ if [[ -z $GITHUB_EVENT_PULL_REQUEST_BASE_REF ]]; then if [[ -f .git/shallow ]]; then echo "Fetching remote refs..." # shellcheck disable=SC2086 - git fetch $EXTRA_ARGS -u --progress --deepen="$INPUT_FETCH_DEPTH" origin "$CURRENT_BRANCH" 1>/dev/null || true + git fetch $EXTRA_ARGS -u --progress --deepen="$INPUT_FETCH_DEPTH" origin +refs/heads/"$CURRENT_BRANCH":refs/remotes/origin/"$CURRENT_BRANCH" 1>/dev/null + git branch --track "$CURRENT_BRANCH" origin/"$CURRENT_BRANCH" 1>/dev/null || true fi echo "::debug::Getting HEAD SHA..." From 07dba6b85d18482fb68d20c4b936467b0b17baad Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Wed, 15 Feb 2023 19:43:05 -0700 Subject: [PATCH 17/26] Fixed the test --- .github/workflows/test.yml | 1 + diff-sha.sh | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 22a646eb..f0d81cfc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -355,6 +355,7 @@ jobs: with: base_sha: "85bd869" sha: "adde7bb" + fetch_depth: 60000 - name: Verify added files if: steps.changed-files.outputs.added_files != 'test/demo/test/test.txt' diff --git a/diff-sha.sh b/diff-sha.sh index 9798bfea..26f8bcc3 100644 --- a/diff-sha.sh +++ b/diff-sha.sh @@ -61,7 +61,6 @@ if [[ -z $GITHUB_EVENT_PULL_REQUEST_BASE_REF ]]; then echo "Fetching remote refs..." # shellcheck disable=SC2086 git fetch $EXTRA_ARGS -u --progress --deepen="$INPUT_FETCH_DEPTH" origin +refs/heads/"$CURRENT_BRANCH":refs/remotes/origin/"$CURRENT_BRANCH" 1>/dev/null - git branch --track "$CURRENT_BRANCH" origin/"$CURRENT_BRANCH" 1>/dev/null || true fi echo "::debug::Getting HEAD SHA..." From 10999da6dc0311a93efbb48c441d36b96a9dc4cb Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Wed, 15 Feb 2023 19:46:42 -0700 Subject: [PATCH 18/26] Fixed the test --- 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 3221c1be..94fe149e 100755 --- a/get-changed-paths.sh +++ b/get-changed-paths.sh @@ -88,7 +88,7 @@ function get_diff() { git diff --diff-filter="$filter" --name-only --ignore-submodules=all "${sub_commit_pre:-4b825dc642cb6eb9a060e54bf8d69288fbee4904}" "${sub_commit_cur}" | awk -v r="$sub" '{ print "" r "/" $0}' 2>/dev/null ) ) || { - echo "::warning::Failed to get changed files for submodule ($sub) between: $base $sha. Please ensure that submodules are initialized and up to date. See: https://github.com/actions/checkout#usage" >&2 + echo "::warning::Failed to get changed files for submodule ($sub) between: ${sub_commit_pre:-4b825dc642cb6eb9a060e54bf8d69288fbee4904} ${sub_commit_cur}. Please ensure that submodules are initialized and up to date. See: https://github.com/actions/checkout#usage" >&2 } fi done < <(git submodule | awk '{print $2}') @@ -123,7 +123,7 @@ function get_renames() { git log --name-status --ignore-submodules=all "${sub_commit_pre:-4b825dc642cb6eb9a060e54bf8d69288fbee4904}" "${sub_commit_cur}" | { grep -E "^R" || true; } | awk -F '\t' -v d="$INPUT_OLD_NEW_SEPARATOR" '{print $2d$3}' | awk -v r="$sub" '{ print "" r "/" $0}' ) ) || { - echo "::warning::Failed to get renamed files for submodule ($sub) between: $base $sha. Please ensure that submodules are initialized and up to date. See: https://github.com/actions/checkout#usage" >&2 + echo "::warning::Failed to get renamed files for submodule ($sub) between: ${sub_commit_pre:-4b825dc642cb6eb9a060e54bf8d69288fbee4904} ${sub_commit_cur}. Please ensure that submodules are initialized and up to date. See: https://github.com/actions/checkout#usage" >&2 } fi done < <(git submodule | awk '{print $2}') From 0e4863b3a26f4ebd88b64912c8e6e9eec413a8b9 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Wed, 15 Feb 2023 19:59:16 -0700 Subject: [PATCH 19/26] Fixed the test --- diff-sha.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/diff-sha.sh b/diff-sha.sh index 26f8bcc3..c0fc1b2a 100644 --- a/diff-sha.sh +++ b/diff-sha.sh @@ -61,6 +61,7 @@ if [[ -z $GITHUB_EVENT_PULL_REQUEST_BASE_REF ]]; then echo "Fetching remote refs..." # shellcheck disable=SC2086 git fetch $EXTRA_ARGS -u --progress --deepen="$INPUT_FETCH_DEPTH" origin +refs/heads/"$CURRENT_BRANCH":refs/remotes/origin/"$CURRENT_BRANCH" 1>/dev/null + git submodule update --recursive || true fi echo "::debug::Getting HEAD SHA..." From 3253948ff2f66427c571d83495f8442b9dfccd10 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Wed, 15 Feb 2023 20:03:18 -0700 Subject: [PATCH 20/26] Updated the fetch args --- diff-sha.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/diff-sha.sh b/diff-sha.sh index c0fc1b2a..1a23798d 100644 --- a/diff-sha.sh +++ b/diff-sha.sh @@ -12,7 +12,7 @@ IS_TAG="false" if [[ "$GITHUB_REF" == "refs/tags/"* ]]; then IS_TAG="true" - EXTRA_ARGS="--prune --recurse-submodules" + EXTRA_ARGS="--prune --no-recurse-submodules" fi if [[ -z $GITHUB_EVENT_PULL_REQUEST_BASE_REF || "$GITHUB_EVENT_HEAD_REPO_FORK" == "true" ]]; then From 5e3c67ab60be788d984d9ca2fed0092e1a953750 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Wed, 15 Feb 2023 20:06:17 -0700 Subject: [PATCH 21/26] Fixed the test --- diff-sha.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/diff-sha.sh b/diff-sha.sh index 1a23798d..e9413794 100644 --- a/diff-sha.sh +++ b/diff-sha.sh @@ -61,7 +61,7 @@ if [[ -z $GITHUB_EVENT_PULL_REQUEST_BASE_REF ]]; then echo "Fetching remote refs..." # shellcheck disable=SC2086 git fetch $EXTRA_ARGS -u --progress --deepen="$INPUT_FETCH_DEPTH" origin +refs/heads/"$CURRENT_BRANCH":refs/remotes/origin/"$CURRENT_BRANCH" 1>/dev/null - git submodule update --recursive || true + git submodule update --init --recursive || true fi echo "::debug::Getting HEAD SHA..." From e47c489b1541eac6c771195d1ab8158b2333cbba Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Wed, 15 Feb 2023 20:08:38 -0700 Subject: [PATCH 22/26] Fixed the test --- diff-sha.sh | 2 +- get-changed-paths.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/diff-sha.sh b/diff-sha.sh index e9413794..fc1ff303 100644 --- a/diff-sha.sh +++ b/diff-sha.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -set -euo pipefail +set -euxo pipefail INITIAL_COMMIT="false" GITHUB_OUTPUT=${GITHUB_OUTPUT:-""} diff --git a/get-changed-paths.sh b/get-changed-paths.sh index 94fe149e..ca7566a2 100755 --- a/get-changed-paths.sh +++ b/get-changed-paths.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -set -euo pipefail +set -euxo pipefail INPUT_SEPARATOR="${INPUT_SEPARATOR//'%'/'%25'}" INPUT_SEPARATOR="${INPUT_SEPARATOR//'.'/'%2E'}" From 55362b9d1bd8f58f528fd689d8da6f11fb468f91 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Wed, 15 Feb 2023 20:36:23 -0700 Subject: [PATCH 23/26] Fixed the test --- get-changed-paths.sh | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/get-changed-paths.sh b/get-changed-paths.sh index ca7566a2..a7da095f 100755 --- a/get-changed-paths.sh +++ b/get-changed-paths.sh @@ -83,10 +83,7 @@ function get_diff() { if [ -n "$sub_commit_cur" ]; then ( - cd "$sub" && ( - # the strange magic number is a hardcoded "empty tree" commit sha - git diff --diff-filter="$filter" --name-only --ignore-submodules=all "${sub_commit_pre:-4b825dc642cb6eb9a060e54bf8d69288fbee4904}" "${sub_commit_cur}" | awk -v r="$sub" '{ print "" r "/" $0}' 2>/dev/null - ) + cd "$sub" && git diff --diff-filter="$filter" --name-only --ignore-submodules=all "${sub_commit_pre:-4b825dc642cb6eb9a060e54bf8d69288fbee4904}" "${sub_commit_cur}" | awk -v r="$sub" '{ print "" r "/" $0}' 2>/dev/null ) || { echo "::warning::Failed to get changed files for submodule ($sub) between: ${sub_commit_pre:-4b825dc642cb6eb9a060e54bf8d69288fbee4904} ${sub_commit_cur}. Please ensure that submodules are initialized and up to date. See: https://github.com/actions/checkout#usage" >&2 } @@ -118,10 +115,7 @@ function get_renames() { if [ -n "$sub_commit_cur" ]; then ( - cd "$sub" && ( - # the strange magic number is a hardcoded "empty tree" commit sha - git log --name-status --ignore-submodules=all "${sub_commit_pre:-4b825dc642cb6eb9a060e54bf8d69288fbee4904}" "${sub_commit_cur}" | { grep -E "^R" || true; } | awk -F '\t' -v d="$INPUT_OLD_NEW_SEPARATOR" '{print $2d$3}' | awk -v r="$sub" '{ print "" r "/" $0}' - ) + cd "$sub" && git log --name-status --ignore-submodules=all "${sub_commit_pre:-4b825dc642cb6eb9a060e54bf8d69288fbee4904}" "${sub_commit_cur}" | { grep -E "^R" || true; } | awk -F '\t' -v d="$INPUT_OLD_NEW_SEPARATOR" '{print $2d$3}' | awk -v r="$sub" '{ print "" r "/" $0}' ) || { echo "::warning::Failed to get renamed files for submodule ($sub) between: ${sub_commit_pre:-4b825dc642cb6eb9a060e54bf8d69288fbee4904} ${sub_commit_cur}. Please ensure that submodules are initialized and up to date. See: https://github.com/actions/checkout#usage" >&2 } From 8aea4cfc1977e0d000bd8bc4557f58f4b4984c82 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Wed, 15 Feb 2023 20:39:45 -0700 Subject: [PATCH 24/26] Fixed the test --- .github/workflows/test.yml | 2 +- get-changed-paths.sh | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f0d81cfc..f1c232f7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -347,7 +347,7 @@ jobs: - name: Checkout to branch uses: actions/checkout@v3 with: - submodules: true + submodules: recursive - name: Run changed-files with submodule id: changed-files diff --git a/get-changed-paths.sh b/get-changed-paths.sh index a7da095f..ca7566a2 100755 --- a/get-changed-paths.sh +++ b/get-changed-paths.sh @@ -83,7 +83,10 @@ function get_diff() { if [ -n "$sub_commit_cur" ]; then ( - cd "$sub" && git diff --diff-filter="$filter" --name-only --ignore-submodules=all "${sub_commit_pre:-4b825dc642cb6eb9a060e54bf8d69288fbee4904}" "${sub_commit_cur}" | awk -v r="$sub" '{ print "" r "/" $0}' 2>/dev/null + cd "$sub" && ( + # the strange magic number is a hardcoded "empty tree" commit sha + git diff --diff-filter="$filter" --name-only --ignore-submodules=all "${sub_commit_pre:-4b825dc642cb6eb9a060e54bf8d69288fbee4904}" "${sub_commit_cur}" | awk -v r="$sub" '{ print "" r "/" $0}' 2>/dev/null + ) ) || { echo "::warning::Failed to get changed files for submodule ($sub) between: ${sub_commit_pre:-4b825dc642cb6eb9a060e54bf8d69288fbee4904} ${sub_commit_cur}. Please ensure that submodules are initialized and up to date. See: https://github.com/actions/checkout#usage" >&2 } @@ -115,7 +118,10 @@ function get_renames() { if [ -n "$sub_commit_cur" ]; then ( - cd "$sub" && git log --name-status --ignore-submodules=all "${sub_commit_pre:-4b825dc642cb6eb9a060e54bf8d69288fbee4904}" "${sub_commit_cur}" | { grep -E "^R" || true; } | awk -F '\t' -v d="$INPUT_OLD_NEW_SEPARATOR" '{print $2d$3}' | awk -v r="$sub" '{ print "" r "/" $0}' + cd "$sub" && ( + # the strange magic number is a hardcoded "empty tree" commit sha + git log --name-status --ignore-submodules=all "${sub_commit_pre:-4b825dc642cb6eb9a060e54bf8d69288fbee4904}" "${sub_commit_cur}" | { grep -E "^R" || true; } | awk -F '\t' -v d="$INPUT_OLD_NEW_SEPARATOR" '{print $2d$3}' | awk -v r="$sub" '{ print "" r "/" $0}' + ) ) || { echo "::warning::Failed to get renamed files for submodule ($sub) between: ${sub_commit_pre:-4b825dc642cb6eb9a060e54bf8d69288fbee4904} ${sub_commit_cur}. Please ensure that submodules are initialized and up to date. See: https://github.com/actions/checkout#usage" >&2 } From 6498ab1ae4bc23e7f4180b91b8f979255453837f Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Wed, 15 Feb 2023 20:43:10 -0700 Subject: [PATCH 25/26] Fixed the test --- diff-sha.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/diff-sha.sh b/diff-sha.sh index fc1ff303..7243f7f0 100644 --- a/diff-sha.sh +++ b/diff-sha.sh @@ -61,7 +61,8 @@ if [[ -z $GITHUB_EVENT_PULL_REQUEST_BASE_REF ]]; then echo "Fetching remote refs..." # shellcheck disable=SC2086 git fetch $EXTRA_ARGS -u --progress --deepen="$INPUT_FETCH_DEPTH" origin +refs/heads/"$CURRENT_BRANCH":refs/remotes/origin/"$CURRENT_BRANCH" 1>/dev/null - git submodule update --init --recursive || true + # shellcheck disable=SC2086 + git submodule foreach git fetch $EXTRA_ARGS -u --progress --deepen="$INPUT_FETCH_DEPTH" || true fi echo "::debug::Getting HEAD SHA..." From 598d24527e92cb715014312fd5ca18e72996cd15 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Wed, 15 Feb 2023 20:45:00 -0700 Subject: [PATCH 26/26] Remove debugging --- diff-sha.sh | 2 +- get-changed-paths.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/diff-sha.sh b/diff-sha.sh index 7243f7f0..f8827ae1 100644 --- a/diff-sha.sh +++ b/diff-sha.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -set -euxo pipefail +set -euo pipefail INITIAL_COMMIT="false" GITHUB_OUTPUT=${GITHUB_OUTPUT:-""} diff --git a/get-changed-paths.sh b/get-changed-paths.sh index ca7566a2..94fe149e 100755 --- a/get-changed-paths.sh +++ b/get-changed-paths.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -set -euxo pipefail +set -euo pipefail INPUT_SEPARATOR="${INPUT_SEPARATOR//'%'/'%25'}" INPUT_SEPARATOR="${INPUT_SEPARATOR//'.'/'%2E'}"