Skip to content

chore: add a workflow to lint commit messages in CI #1

chore: add a workflow to lint commit messages in CI

chore: add a workflow to lint commit messages in CI #1

Workflow file for this run

name: Lint Commit Messages
on:
push:
branches-ignore:
- dependabot/**
jobs:
commitlint:
name: Check Commit Messages
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/[email protected]
- name: Install Commitlint
run: |
npm install conventional-changelog-conventionalcommits
npm install commitlint@latest
- name: Validate Current Commit (Last Commit) With Commitlint
if: github.event_name == "push"

Check failure on line 22 in .github/workflows/commitlint.yml

View workflow run for this annotation

GitHub Actions / Lint Commit Messages

Invalid workflow file

The workflow is not valid. .github/workflows/commitlint.yml (Line: 22, Col: 13): Unexpected symbol: '"push"'. Located at position 22 within expression: github.event_name == "push" .github/workflows/commitlint.yml (Line: 27, Col: 13): Unexpected symbol: '"pull_request"'. Located at position 22 within expression: github.event_name == "pull_request"
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