diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 30a4bc1..c0ed349 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,11 +26,5 @@ jobs: - uses: actions/checkout@v2 # Runs a single command using the runners shell - - name: Run a one-line script - run: echo Hello, world! - - # Runs a set of commands using the runners shell - - name: Run a multi-line script - run: | - echo Add other actions to build, - echo test, and deploy your project. + - name: shell check + run: docker-compose run --rm shellcheck ./validate.sh diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..4349a5a --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,8 @@ +--- +version: '3.9' +services: + shellcheck: + image: koalaman/shellcheck-alpine:latest + volumes: + - ".:/build" + working_dir: /build diff --git a/validate.sh b/validate.sh new file mode 100755 index 0000000..c732d71 --- /dev/null +++ b/validate.sh @@ -0,0 +1,11 @@ +#!/bin/sh -l + +set -euo pipefile + +rc=0 +for filename in $(find ./* -name '*.sh'); do + echo "Validating" + shellcheck "${filename}" || exit $? +done + +exit $? \ No newline at end of file