From a6ef7dec25215f676903d101505df6ff3f5a6808 Mon Sep 17 00:00:00 2001 From: Scott Brenner Date: Sun, 11 Oct 2020 20:57:00 -0700 Subject: [PATCH 1/8] SC2086: Double quote to prevent globbing and word splitting. --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 8386534..2f06a77 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,6 +1,6 @@ #!/bin/sh -l -git clone --quiet https://github.com/$REPO &> /dev/null +git clone --quiet https://github.com/"$REPO" &> /dev/null if [ "$REPO" == "ScottBrenner/generate-changelog-action" ]; then cd generate-changelog-action From e64f0b08022e66e72af21b8ae8bc8af8eda11d2a Mon Sep 17 00:00:00 2001 From: Scott Brenner Date: Sun, 11 Oct 2020 20:57:39 -0700 Subject: [PATCH 2/8] SC3020: In POSIX sh, &> is undefined. --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 2f06a77..ed94d98 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,6 +1,6 @@ #!/bin/sh -l -git clone --quiet https://github.com/"$REPO" &> /dev/null +git clone --quiet https://github.com/"$REPO" if [ "$REPO" == "ScottBrenner/generate-changelog-action" ]; then cd generate-changelog-action From b4776b99b94695b281b55b18624585637dcae34a Mon Sep 17 00:00:00 2001 From: Scott Brenner Date: Sun, 11 Oct 2020 20:58:15 -0700 Subject: [PATCH 3/8] SC3014: 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 ed94d98..e4c1225 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,7 +2,7 @@ git clone --quiet https://github.com/"$REPO" -if [ "$REPO" == "ScottBrenner/generate-changelog-action" ]; then +if [ "$REPO" = "ScottBrenner/generate-changelog-action" ]; then cd generate-changelog-action fi From dcebcc6403e6bcf07694e1fab515959d962e472b Mon Sep 17 00:00:00 2001 From: Scott Brenner Date: Sun, 11 Oct 2020 20:59:07 -0700 Subject: [PATCH 4/8] SC2164: Use 'cd ... || exit' or 'cd ... || return' in case cd fails. --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index e4c1225..bab9a8a 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -3,7 +3,7 @@ git clone --quiet https://github.com/"$REPO" if [ "$REPO" = "ScottBrenner/generate-changelog-action" ]; then - cd generate-changelog-action + cd generate-changelog-action || exit fi if [ "$1" ] && [ "$1" != "package.json" ]; then From 7f9e39276ab6d1c199de712cb8db684cd9e66ac3 Mon Sep 17 00:00:00 2001 From: Scott Brenner Date: Sun, 11 Oct 2020 21:01:43 -0700 Subject: [PATCH 5/8] SC2086: Double quote to prevent globbing and word splitting. --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index bab9a8a..8c82458 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -17,6 +17,6 @@ changelog="${changelog//'%'/'%25'}" changelog="${changelog//$'\n'/'%0A'}" changelog="${changelog//$'\r'/'%0D'}" -echo $changelog +echo "$changelog" echo "::set-output name=changelog::$changelog" From ebedf2d35163f7418a9f7678e7baa27a01009ea8 Mon Sep 17 00:00:00 2001 From: Scott Brenner Date: Sun, 11 Oct 2020 21:06:55 -0700 Subject: [PATCH 6/8] ignore In POSIX sh, $'..' is undefined. --- entrypoint.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/entrypoint.sh b/entrypoint.sh index 8c82458..7489093 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,4 +1,5 @@ #!/bin/sh -l +# shellcheck disable=SC3000-SC4000 git clone --quiet https://github.com/"$REPO" From 7644a6dde133a2523236f94b5140dd5e46c80241 Mon Sep 17 00:00:00 2001 From: Scott Brenner Date: Sun, 11 Oct 2020 21:13:07 -0700 Subject: [PATCH 7/8] Change shellcheck disable --- entrypoint.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 7489093..2235ce1 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,5 +1,6 @@ #!/bin/sh -l -# shellcheck disable=SC3000-SC4000 +# shellcheck disable=SC3060 +# shellcheck disable=SC3003 git clone --quiet https://github.com/"$REPO" From 687dfb1d7884c68a757f677899f7ca838016b7d7 Mon Sep 17 00:00:00 2001 From: Scott Brenner Date: Sun, 11 Oct 2020 21:16:07 -0700 Subject: [PATCH 8/8] Change shellcheck disable --- entrypoint.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 2235ce1..929f45c 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,6 +1,5 @@ #!/bin/sh -l -# shellcheck disable=SC3060 -# shellcheck disable=SC3003 +# shellcheck disable=SC2039 git clone --quiet https://github.com/"$REPO"