From 1ede5658c42455b95a49594f8fb926cbdec7f077 Mon Sep 17 00:00:00 2001 From: Ashish Bhatia Date: Sun, 30 Mar 2025 00:54:31 -0700 Subject: [PATCH] ci: add Shell script linter --- .github/workflows/lint-shell-script.yaml | 46 ++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/lint-shell-script.yaml diff --git a/.github/workflows/lint-shell-script.yaml b/.github/workflows/lint-shell-script.yaml new file mode 100644 index 0000000..7aa09e7 --- /dev/null +++ b/.github/workflows/lint-shell-script.yaml @@ -0,0 +1,46 @@ +# Generated by Gabo (https://github.com/ashishb/gabo) +--- +# Run this locally with act - https://github.com/nektos/act +# act -j lintShellScript +name: Lint Shell scripts + +on: # yamllint disable-line rule:truthy + push: + branches: [main, master] + paths: + - "**.sh" + - "**.bash" + - ".github/workflows/lint-shell-script.yaml" + pull_request: + branches: [main, master] + paths: + - "**.sh" + - "**.bash" + - ".github/workflows/lint-shell-script.yaml" + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +# Ref: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/controlling-permissions-for-github_token +permissions: + contents: read + +jobs: + + lintShellScript: + runs-on: ubuntu-latest + timeout-minutes: 15 + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Remove some files + # These are some code files that fails shell lint and we don't want to modify these + run: rm './braintest_or_ghostpush/tsnef(pessword)/post.sh' + + - name: Run ShellCheck + uses: ludeeus/action-shellcheck@2.0.0