Implementing Commitlint with Conventional Commit Configuration #78
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: Tests | |
on: [push, pull_request] | |
env: | |
HUSKY: 0 # for disable husky on ci | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [20.x, 21.x] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Testing with Node.js v${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
# Checks if package-lock.json is Up To Date | |
# https://www.npmjs.com/package/package-lock-utd | |
- name: Check package-lock.json | |
run: npm exec --yes [email protected] | |
# https://docs.npmjs.com/cli/v10/commands/npm-ci | |
- name: Install Package | |
run: npm ci | |
# https://commitlint.js.org/guides/ci-setup.html#github-actions | |
- 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 --color | |
- name: Run Lint | |
run: npm run lint | |
- name: Run Test | |
run: npm run test:ci | |
- name: Run Build | |
run: npm run build |