From 25e40c1a1170c02ea2440c5b1e9a6b9107e7829d 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/shellcheck.yml | 35 +++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .forgejo/workflows/shellcheck.yml diff --git a/.forgejo/workflows/shellcheck.yml b/.forgejo/workflows/shellcheck.yml new file mode 100644 index 0000000..c73f7ce --- /dev/null +++ b/.forgejo/workflows/shellcheck.yml @@ -0,0 +1,35 @@ +name: Bash Linter and Commit Checker + +on: + push: + paths: + - '**/*.sh' + pull_request: + paths: + - '**/*.sh' + +jobs: + bash-linter: + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v4 # Minimal required to access code + + - name: Install ShellCheck + run: sudo apt-get update && sudo apt-get install -y shellcheck + + - name: Lint Bash Scripts + run: | + find . -name '*.sh' -print0 | xargs -0 shellcheck + + commit-message-checker: + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v4 # Access repository to validate commits + + - name: Check Commit Messages + run: | + git log -1 --pretty=%B | grep -Eq "^(feat|fix|docs|style|refactor|test|chore): .+" || \ + (echo "Invalid commit message format. Please follow ': ' format." && exit 1) +