diff --git a/.forgejo/workflows/shellcheck.yml b/.forgejo/workflows/shellcheck.yml new file mode 100644 index 0000000..c73f7ce --- /dev/null +++ b/.forgejo/workflows/shellcheck.yml @@ -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 ': ' format." && exit 1) +