Skip to content

Commit

Permalink
ci: Add Conventional Commits linter for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
KingMob committed May 3, 2024
1 parent 689fe74 commit c016239
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/commit-linter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: commit-linter

on:
pull_request:
push:
branches: [main]

jobs:
commit-lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: cachix/install-nix-action@v25
with:
nix_path: nixpkgs=channel:nixos-unstable

- uses: DeterminateSystems/magic-nix-cache-action@main

- name: npm install
run: nix develop --command npm install --include=dev

- name: Print versions
run: |
git --version
node --version
npm --version
npx commitlint --version
- name: Validate current commit (last commit) with commitlint
if: github.event_name == 'push'
run: nix develop --command npx commitlint --last --verbose

- name: Validate PR commits with commitlint
if: github.event_name == 'pull_request'
run: nix develop --command npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose

0 comments on commit c016239

Please sign in to comment.