Skip to content

Commit 71f4df9

Browse files
Merge pull request francescopepe#11 from francescopepe/FP/add-commit-lint
Add commit lint
2 parents 055fdd4 + 2c1fa9e commit 71f4df9

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

.github/workflows/lint.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,27 @@ jobs:
3434
with:
3535
go-version-input: '~1.22.0'
3636
check-latest: true
37+
38+
commitlint:
39+
runs-on: ubuntu-latest
40+
steps:
41+
- uses: actions/checkout@v3
42+
with:
43+
fetch-depth: 0
44+
45+
- name: Install NodeJS
46+
uses: actions/setup-node@v4
47+
with:
48+
node-version: 18
49+
50+
- name: Install commitlint and convention
51+
run: |
52+
npm install commitlint@latest @commitlint/config-conventional
53+
54+
- name: Validate current commit (last commit) with commitlint
55+
if: github.event_name == 'push'
56+
run: npx commitlint --from HEAD~1 --to HEAD --verbose
57+
58+
- name: Validate PR commits with commitlint
59+
if: github.event_name == 'pull_request'
60+
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose

commitlint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = {extends: ['@commitlint/config-conventional']}

0 commit comments

Comments
 (0)