From 39905e8bd39e1ed4ba3197ca731f978ea26b348a Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 9 Mar 2023 13:24:28 -0500 Subject: [PATCH 1/2] Add github action to shellcheck master on push and PRs --- .github/workflows/shellcheck.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 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 0000000000..96773089ae --- /dev/null +++ b/.github/workflows/shellcheck.yml @@ -0,0 +1,24 @@ +--- +name: Shellcheck + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + shellcheck: + name: Check shell scripts + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Install dependencies + run: | + sudo apt update && sudo apt install -y shellcheck + + - name: shellcheck + run: | + git grep -l '^#!\(/bin/\|/usr/bin/env \)\(sh\|bash\|dash\|ksh\)' | xargs shellcheck From c319835f5157f31bb4ccf4e662f79d62370e86ba Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 9 Mar 2023 14:03:34 -0500 Subject: [PATCH 2/2] regenerate action: was broken, and insufficient grepping for related files --- .github/workflows/shellcheck.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml index 96773089ae..087aba7689 100644 --- a/.github/workflows/shellcheck.yml +++ b/.github/workflows/shellcheck.yml @@ -18,7 +18,6 @@ jobs: - name: Install dependencies run: | sudo apt update && sudo apt install -y shellcheck - - - name: shellcheck - run: | - git grep -l '^#!\(/bin/\|/usr/bin/env \)\(sh\|bash\|dash\|ksh\)' | xargs shellcheck + - name: shellcheck + run: | + git grep -l '^#\( *shellcheck \|!\(/bin/\|/usr/bin/env \)\(sh\|bash\|dash\|ksh\)\)' | xargs shellcheck