Skip to content

Commitlint

Commitlint #3592

Workflow file for this run

name: Commitlint
on:
push:
branches: [main]
pull_request:
branches: [main]
merge_group:
types: [checks_requested]
branches: [main]
jobs:
Commitlint:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.REPO_SCOPED_TOKEN }}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
fetch-depth: 0
- name: install commitlint
run: npm install -g @commitlint/config-conventional @commitlint/cli
- name: Validate current commit (last commit) with commitlint
if: github.event_name == 'push'
run: commitlint --from HEAD~1 --to HEAD --verbose
- name: Validate PR commits with commitlint
if: github.event_name == 'pull_request'
run: commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose