From ead6a1bf1325628021e9f4e7eb5c1b8b7548b700 Mon Sep 17 00:00:00 2001 From: dcarrillo Date: Sat, 7 Mar 2020 19:08:09 +0100 Subject: [PATCH 1/4] Add linting at github actions --- .github/workflows/main.yml | 6 ++++++ Dockerfile | 3 ++- build.sh | 1 + tests/test.sh | 2 ++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 74ffc85..d80896f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,6 +14,12 @@ jobs: steps: - uses: actions/checkout@v1 + - name: shellcheck + uses: ludeeus/action-shellcheck@master + + - name: hadolint + uses: brpaz/hadolint-action@master + - name: Build image run: ./build.sh diff --git a/Dockerfile b/Dockerfile index 4c4bfcb..b635332 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,8 @@ ARG ARG_NGX_GEOIP2_VERSION ENV NGINX_VERSION $ARG_NGINX_VERSION ENV NGX_GEOIP2_VERSION $ARG_NGX_GEOIP2_VERSION -RUN CONFIG="\ +# hadolint ignore=DL3018,DL3003,SC2086 +RUN CONFIG=" \ --add-module=/tmp/ngx_http_geoip2_module-$NGX_GEOIP2_VERSION \ --with-stream \ --with-http_ssl_module \ diff --git a/build.sh b/build.sh index ed29c0e..f0be79d 100755 --- a/build.sh +++ b/build.sh @@ -2,6 +2,7 @@ set -e +# shellcheck disable=SC1090 . "$(dirname "$0")"/conf.env while [ $# -gt 0 ]; do diff --git a/tests/test.sh b/tests/test.sh index 3ece44e..adf057d 100755 --- a/tests/test.sh +++ b/tests/test.sh @@ -6,11 +6,13 @@ if [ x"$DEBUG" = xtrue ]; then set -x fi +# shellcheck disable=SC2039 trap _catch_err ERR trap _cleanup EXIT ALPINE_VERSION="alpine:3.11" LOCAL_DIR="$(cd "$(dirname "$0")" ; pwd -P)" +# shellcheck disable=SC1090 . "$LOCAL_DIR"/../conf.env TMP_DIR=$(mktemp -d) From 321777062b9ccf46587899f7d1a335366b475b0c Mon Sep 17 00:00:00 2001 From: dcarrillo Date: Sat, 7 Mar 2020 19:17:32 +0100 Subject: [PATCH 2/4] Update shell linting github action for a more recent one --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d80896f..d7d860f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/checkout@v1 - name: shellcheck - uses: ludeeus/action-shellcheck@master + uses: fearphage/shellcheck-action - name: hadolint uses: brpaz/hadolint-action@master From 87140d9b89f6467109397f0ed025114d976b9397 Mon Sep 17 00:00:00 2001 From: dcarrillo Date: Sat, 7 Mar 2020 19:18:52 +0100 Subject: [PATCH 3/4] Fix typo at github actions main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d7d860f..b95939b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/checkout@v1 - name: shellcheck - uses: fearphage/shellcheck-action + uses: fearphage/shellcheck-action@master - name: hadolint uses: brpaz/hadolint-action@master From 5f89bb8883e7373b5c53e7d23c5c37e3338dc132 Mon Sep 17 00:00:00 2001 From: dcarrillo Date: Sat, 7 Mar 2020 19:21:43 +0100 Subject: [PATCH 4/4] Try another linter... --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b95939b..ee3dab0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/checkout@v1 - name: shellcheck - uses: fearphage/shellcheck-action@master + uses: azohra/shell-linter@v0.1.0 - name: hadolint uses: brpaz/hadolint-action@master