Skip to content

Enforce Conventional Commits #10

Enforce Conventional Commits

Enforce Conventional Commits #10

Workflow file for this run

---
name: Build
on:
pull_request: {}
push:
branches:
- master
jobs:
commitlint:
name: Commit Lint
runs-on: ubuntu-latest
steps:
- name: Check out the codebase
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 21
- name: Install Node modules
run: npm install
- name: Check program versions
run: |
node --version
npm --version
npm run commitlint -- --version
- name: Validate last commit
if: github.event_name == 'push'
run: npm run commitlint -- --from=HEAD~1 --to=HEAD --verbose
- name: Validate commits in pull request
if: github.event_name == 'pull_request'
run: >-
npm run commitlint --
--from=${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }}
--to=${{ github.event.pull_request.head.sha }}
--verbose