From 7581374e1923179b5f6b73e2dca4ed1a447f5413 Mon Sep 17 00:00:00 2001 From: ZoopaMario Date: Sun, 29 Dec 2024 04:06:54 +0100 Subject: [PATCH] Add bash linter workflow Using the checkout@v4 action on each push and pull request --- .forgejo/workflows/lint-bash.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .forgejo/workflows/lint-bash.yml diff --git a/.forgejo/workflows/lint-bash.yml b/.forgejo/workflows/lint-bash.yml new file mode 100644 index 0000000..2798744 --- /dev/null +++ b/.forgejo/workflows/lint-bash.yml @@ -0,0 +1,31 @@ +name: Lint Bash Scripts + +on: + push: + paths: + - '**/*.sh' + pull_request: + paths: + - '**/*.sh' + +jobs: + lint-bash: + runs-on: docker + container: + image: node:16-bullseye # Node.js pre-installed, based on Debian + + steps: + - name: Checkout Code + uses: https://code.forgejo.org/actions/checkout@v4 + with: + fetch-depth: 0 # Fetch the entire history to avoid REST API reliance + + - name: Install ShellCheck + run: | + apt-get update && apt-get install -y shellcheck + + - name: Lint Bash Scripts + run: | + echo "Linting Bash scripts..." + find . -name '*.sh' -print0 | xargs -0 shellcheck +