chore: configure commitlint on CI #1
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: commitlint | |
on: | |
push: | |
branches: | |
- main | |
pull_request: {} | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
commitlint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: wyvox/action-setup-pnpm@v3 | |
name: Install pnpm and node | |
with: | |
pnpm-version: 8.5.1 | |
node-version: 18.x | |
- name: Print versions | |
run: | | |
git --version | |
node --version | |
pnpm --version | |
- name: Install commitlint | |
run: | | |
pnpm install @commitlint/cli@"$(pnpm show @commitlint/cli version)" | |
pnpm install @commitlint/config-conventional@"$(pnpm show @commitlint/config-conventional version)" | |
- name: Validate current commit (last commit) with commitlint | |
if: github.event_name == 'push' | |
run: pnpm commitlint --from HEAD~1 --to HEAD --verbose | |
- name: Validate PR commits with commitlint | |
if: github.event_name == 'pull_request' | |
run: pnpm commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose |