36 lines
919 B
YAML
36 lines
919 B
YAML
|
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)
|
||
|
|