Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

PR validation recipe

A complete PR validation pipeline combining commitlint with your existing test steps.

GitHub Actions

# .github/workflows/pr.yml
name: PR validation
on: pull_request

jobs:
  commitlint:
    name: Lint commits
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with: { fetch-depth: 0 }
      - uses: driftsys/ci/actions/commitlint@v0
        with:
          range: ${{ github.event.pull_request.base.sha }}..HEAD

  test:
    name: Tests
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: just test

Release workflow

Pair release with a release job that runs only on the default branch:

# .github/workflows/release.yml
name: Release
on:
  push:
    branches: [main]

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with: { fetch-depth: 0 }
      - uses: driftsys/ci/actions/release@v0

GitLab CI

# .gitlab-ci.yml
include:
  - component: gitlab.com/driftsys/ci/commitlint@~latest
  - component: gitlab.com/driftsys/ci/release@~latest