.github/actions/lint-commit/action.yml
name: Verify commit format
description: Verify that the commit message format is correct
runs:
using: "composite"
steps:
- uses: actions/checkout@v4
id: commitlint
with:
fetch-depth: 0
- name: install
shell: bash
run: npm i
- name: Validate current commit on push
shell: bash
if: github.event_name == 'push'
run: npx commitlint --last --verbose
- name: Validate PR commits
shell: bash
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