chore(repo): enforce conventional commits
This commit is contained in:
1 parent
60d4db8780
commit
09c50c136f
6 files changed
+1129
-1
No files matched your search
@@ -0,0 +1,53 @@
|
||||
name: Commit Lint
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
commitlint:
|
||||
name: Validate Commit Messages
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: "20"
|
||||
cache: "npm"
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Lint commit messages
|
||||
shell: bash
|
||||
run: |
|
||||
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
|
||||
FROM="${{ github.event.pull_request.base.sha }}"
|
||||
TO="${{ github.event.pull_request.head.sha }}"
|
||||
else
|
||||
FROM="${{ github.event.before }}"
|
||||
TO="${{ github.sha }}"
|
||||
fi
|
||||
|
||||
if [[ "$FROM" == "0000000000000000000000000000000000000000" ]]; then
|
||||
npx commitlint --last --verbose
|
||||
else
|
||||
npx commitlint --from "$FROM" --to "$TO" --verbose
|
||||
fi
|
||||
Reference in new issue
Block a user