Skip to content

Commit

Permalink
Merge pull request francescopepe#11 from francescopepe/FP/add-commit-…
Browse files Browse the repository at this point in the history
…lint

Add commit lint
  • Loading branch information
francescopepe authored Feb 14, 2024
2 parents 055fdd4 + 2c1fa9e commit 71f4df9
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,27 @@ jobs:
with:
go-version-input: '~1.22.0'
check-latest: true

commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install NodeJS
uses: actions/setup-node@v4
with:
node-version: 18

- name: Install commitlint and convention
run: |
npm install commitlint@latest @commitlint/config-conventional
- name: Validate current commit (last commit) with commitlint
if: github.event_name == 'push'
run: npx commitlint --from HEAD~1 --to HEAD --verbose

- name: Validate PR commits with commitlint
if: github.event_name == 'pull_request'
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = {extends: ['@commitlint/config-conventional']}

0 comments on commit 71f4df9

Please sign in to comment.