Enforce Conventional Commits #10
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
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 |