Add shellcheck workflow
This commit is contained in:
parent
f0fd008e1d
commit
e8399bda00
45
.forgejo/workflows/lint-and-validate.yml
Normal file
45
.forgejo/workflows/lint-and-validate.yml
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
name: Lint and Validate
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- '**/*.sh'
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- '**/*.sh'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint-and-validate:
|
||||||
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image: debian:bullseye
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Install Prerequisites
|
||||||
|
run: |
|
||||||
|
apt-get update && apt-get install -y git curl
|
||||||
|
curl -fsSL https://deb.nodesource.com/setup_16.x | bash -
|
||||||
|
apt-get install -y nodejs
|
||||||
|
|
||||||
|
- name: Checkout Code
|
||||||
|
uses: https://code.forgejo.org/actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0 # Fetch the entire history to avoid REST API reliance
|
||||||
|
|
||||||
|
- name: Install ShellCheck
|
||||||
|
run: |
|
||||||
|
apt-get update && apt-get install -y shellcheck
|
||||||
|
|
||||||
|
- name: Lint Bash Scripts
|
||||||
|
run: |
|
||||||
|
echo "Linting Bash scripts..."
|
||||||
|
find . -name '*.sh' -print0 | xargs -0 shellcheck
|
||||||
|
|
||||||
|
- name: Check Commit Messages
|
||||||
|
run: |
|
||||||
|
echo "Checking commit message format..."
|
||||||
|
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