Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: commitlint

# Validate Conventional Commits (ADR-0002) with commitlint as the SINGLE engine,
# on both the PR commits and the PR title (the squash-merge subject that feeds
# release-please). Only official actions/* + the @commitlint/* packages — no
# third-party actions (supply-chain hardening; Phase 4/5 orientation).

on:
pull_request:
branches:
- master
types:
- opened
- edited
- synchronize
- reopened

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
commitlint:
runs-on: ubuntu-22.04
steps:
# TODO(supply-chain): pin actions to commit SHA — via Renovate digest
# pinning once #122 lands, or provide the SHAs to pin manually (ADR-0002 / #99).
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install commitlint
run: npm install --no-save @commitlint/cli @commitlint/config-conventional

- name: Lint PR commits
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: npx commitlint --from "$BASE_SHA" --to "$HEAD_SHA" --verbose

- name: Lint PR title
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: printf '%s' "$PR_TITLE" | npx commitlint --verbose
3 changes: 3 additions & 0 deletions commitlint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {
extends: ["@commitlint/config-conventional"],
};
Loading