From 5976ffe1e8725de68ba50de2f327bed3c84ec13a Mon Sep 17 00:00:00 2001 From: haya14busa Date: Thu, 26 Sep 2019 15:03:44 +0000 Subject: [PATCH 1/4] debug: add test code --- testdata/test.sh | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 testdata/test.sh diff --git a/testdata/test.sh b/testdata/test.sh new file mode 100644 index 0000000..d520aae --- /dev/null +++ b/testdata/test.sh @@ -0,0 +1,2 @@ +echo $1 # Unquoted variables +find . -name *.ogg # Unquoted find/grep patterns From a5735cdcffa7e9925ac004045a4e98995842b399 Mon Sep 17 00:00:00 2001 From: haya14busa Date: Thu, 26 Sep 2019 15:08:06 +0000 Subject: [PATCH 2/4] use "${...}" --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 2602a39..2c65c13 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,6 +1,6 @@ #!/bin/sh -cd "$GITHUB_WORKSPACE" +cd "${GITHUB_WORKSPACE}" export REVIEWDOG_GITHUB_API_TOKEN="${INPUT_GITHUB_TOKEN}" From 587ff186b0513be108c49ffbe305669a296ffe0a Mon Sep 17 00:00:00 2001 From: haya14busa Date: Thu, 26 Sep 2019 15:10:46 +0000 Subject: [PATCH 3/4] Fix https://github.com/koalaman/shellcheck/wiki/SC2164 --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 2c65c13..03df218 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,6 +1,6 @@ #!/bin/sh -cd "${GITHUB_WORKSPACE}" +cd "${GITHUB_WORKSPACE}" || exit export REVIEWDOG_GITHUB_API_TOKEN="${INPUT_GITHUB_TOKEN}" From 03ebd62452851594db3f6b00a40d841848bdea72 Mon Sep 17 00:00:00 2001 From: haya14busa Date: Thu, 26 Sep 2019 15:12:47 +0000 Subject: [PATCH 4/4] Fix SC2039: In POSIX sh, == in place of = is undefined. --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index e214c3b..9dc7387 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -4,7 +4,7 @@ cd "${GITHUB_WORKSPACE}" || exit export REVIEWDOG_GITHUB_API_TOKEN="${INPUT_GITHUB_TOKEN}" -if [ "${INPUT_REPORTER}" == 'github-pr-review' ]; then +if [ "${INPUT_REPORTER}" = 'github-pr-review' ]; then # erroformat: https://git.io/JeGMU shellcheck -f json ${INPUT_SHELLCHECK_FLAGS:-'--external-sources'} $(find "${INPUT_PATH:-'.'}" -not -path "${INPUT_EXCLUDE}" -type f -name "${INPUT_PATTERN:-'*.sh'}") \ | jq -r '.[] | "\(.file):\(.line):\(.column):\(.level):\(.message) [SC\(.code)](https://github.com/koalaman/shellcheck/wiki/SC\(.code))"' \