36 lines
868 B
YAML
36 lines
868 B
YAML
|
name: Validate Code
|
||
|
|
||
|
on:
|
||
|
push:
|
||
|
paths:
|
||
|
- '**/*.sh'
|
||
|
pull_request:
|
||
|
paths:
|
||
|
- '**/*.sh'
|
||
|
|
||
|
jobs:
|
||
|
lint-and-validate:
|
||
|
runs-on: docker # Using Docker-based runner
|
||
|
|
||
|
steps:
|
||
|
- name: Checkout Code
|
||
|
uses: actions/checkout@v4
|
||
|
|
||
|
- name: Install ShellCheck
|
||
|
run: |
|
||
|
apt-get update && apt-get install -y shellcheck
|
||
|
|
||
|
- name: Lint Bash Scripts
|
||
|
run: |
|
||
|
find . -name '*.sh' -print0 | xargs -0 shellcheck
|
||
|
|
||
|
- name: Check Commit Messages
|
||
|
run: |
|
||
|
echo "Validating commit messages"
|
||
|
# Customize this script to your commit message standards
|
||
|
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: <type>: <subject>"
|
||
|
exit 1
|
||
|
fi
|
||
|
|