Add shellcheck workflow
This commit is contained in:
parent
f0fd008e1d
commit
25e40c1a11
35
.forgejo/workflows/shellcheck.yml
Normal file
35
.forgejo/workflows/shellcheck.yml
Normal 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)
|
||||||
|
|
Loading…
Reference in a new issue