Add shellcheck workflow

This commit is contained in:
ZoopaMario 2024-12-28 20:42:05 +01:00
parent f0fd008e1d
commit 25e40c1a11

View file

@ -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 '<type>: <description>' format." && exit 1)