Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .commitlintrc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default {
rules: {
"header-max-length": [0, "always", 72],
},
};
44 changes: 44 additions & 0 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: GiT Commit Message Lint

on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]

permissions:
contents: read

jobs:
commitlint:
name: Commit Lint Check
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: "lts/*"

- name: Install dependencies
run: npm install -D @commitlint/cli @commitlint/config-conventional

- name: Print version information
run: |
git --version
node --version
npm --version
npx commitlint --version

- name: Check current commit message (Push event)
if: github.event_name == 'push'
run: npx commitlint --last --verbose

- name: Check PR commit messages (Pull Request event)
if: github.event_name == 'pull_request'
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
Loading