From e95970bbaad8de3a6de5717b722e936b4f6a5445 Mon Sep 17 00:00:00 2001 From: ZoopaMario Date: Sat, 28 Dec 2024 20:42:05 +0100 Subject: [PATCH] Add shellcheck workflow --- .forgejo/workflows/lint-and-validate.yml | 38 ++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .forgejo/workflows/lint-and-validate.yml diff --git a/.forgejo/workflows/lint-and-validate.yml b/.forgejo/workflows/lint-and-validate.yml new file mode 100644 index 0000000..b11ee43 --- /dev/null +++ b/.forgejo/workflows/lint-and-validate.yml @@ -0,0 +1,38 @@ +# .forgejo/workflows/lint-and-validate.yml +name: Lint and Validate + +on: + push: + paths: + - '**/*.sh' + pull_request: + paths: + - '**/*.sh' + +jobs: + lint-and-validate: + runs-on: docker # Ensures the job runs in a Docker-based environment + container: + image: debian:bullseye # Use a lightweight and stable Debian base image + + steps: + - name: Checkout Code + uses: https://code.forgejo.org/actions/checkout@v4 + + - 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 + + - name: Check Commit Messages + run: | + echo "Checking commit message format..." + if ! git log -1 --pretty=%B | grep -Eq '^(feat|fix|chore|docs|style|refactor|test|perf):'; then + echo "Commit message does not follow the conventional format: : " + exit 1 + fi +