From f20cdc7515918968571d529e7ccb294f121fef7e Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Wed, 24 Jul 2024 08:53:49 -1000 Subject: [PATCH 1/2] Add github action to shellcheck do-eks on push and PRs --- .github/workflows/shellcheck.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/shellcheck.yml diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml new file mode 100644 index 0000000..361e2f1 --- /dev/null +++ b/.github/workflows/shellcheck.yml @@ -0,0 +1,26 @@ +--- +name: Shellcheck + +on: + push: + branches: [do-eks] + pull_request: + branches: [do-eks] + +permissions: + contents: read + +jobs: + shellcheck: + name: Check shell scripts + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install dependencies + run: | + sudo apt update && sudo apt install -y shellcheck + - name: shellcheck + run: | + git grep -l '^#\( *shellcheck \|!\(/bin/\|/usr/bin/env \)\(sh\|bash\|dash\|ksh\)\)' | xargs shellcheck From 459adcfb2b1e8c13a9ad03b25efda96f7f130852 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Wed, 24 Jul 2024 08:53:49 -1000 Subject: [PATCH 2/2] Add pre-commit definition for shellcheck --- .pre-commit-config.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5f505b2..c3cdfe9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,3 +25,8 @@ repos: hooks: - id: flake8 args: ['--max-line-length=100'] + +- repo: https://github.com/koalaman/shellcheck-precommit + rev: v0.9.0 + hooks: + - id: shellcheck