Add shellcheck workflow
This commit is contained in:
parent
f0fd008e1d
commit
f1cb8a92a2
35
.forgejo/workflows/shellcheck.yml
Normal file
35
.forgejo/workflows/shellcheck.yml
Normal file
|
@ -0,0 +1,35 @@
|
|||
name: Validate Code
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- '**/*.sh'
|
||||
pull_request:
|
||||
paths:
|
||||
- '**/*.sh'
|
||||
|
||||
jobs:
|
||||
lint-and-validate:
|
||||
runs-on: docker
|
||||
|
||||
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
|
||||
|
Loading…
Reference in a new issue