Files
sencho/.github/workflows/pr-title.yml
Anso 1e52f3f134 ci(release-notes): require a conventional PR title (#2123)
release-please derives the changelog and the version bump from
conventional-commit subjects read off main. Squash-merging takes the
subject from the PR title, so a title the parser cannot read drops the
change from the release notes with no warning. The build-identity
feature (#1899) merged with an untyped title and never appeared in any
release notes.

The local commit-msg hook cannot catch this: it runs against the PR
branch commit and never against the squash that actually lands. Add a
pull_request workflow that validates the title, and read the allowed
types from commitlint.config.js so the two cannot drift.

The check enforces the conventional shape only, not the length or
casing rules the local hook applies to a full commit. Those would only
add noise here: Dependabot generates group titles longer than the
commit header limit, and blocking on that would fail a PR whose title is
otherwise fine.

Correct CONTRIBUTING.md while here. It claimed that hand edits to the
Release PR survive a regeneration; release-please replaces the PR body
and force-pushes the release branch, so they do not. Point the guidance
at the override block, and record that a dependency PR clearing an
advisory must not merge as chore(deps), which is conventional and
therefore passes the new check while staying out of the changelog.
2026-10-12 10:54:22 -04:00

38 lines
1.3 KiB
YAML

name: PR Title
# release-please builds the changelog and the version bump by parsing
# conventional commit subjects off main. Squash-merges take the subject from the
# PR title, so a title the parser cannot read silently drops the change from the
# release notes. The local commit-msg hook does not cover this: it runs on the
# PR branch and never on the squash that actually lands.
#
# Re-runs on `edited` so a title fixed after the push goes green without needing
# a new commit.
on:
pull_request:
branches: [main]
types: [opened, edited, synchronize, reopened]
permissions:
contents: read
concurrency:
group: pr-title-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
pr-title:
name: PR title is a Conventional Commit
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
# The title is passed through the environment, never interpolated into the
# shell script: a title is free text, and a value like $(...) spliced into
# the run block would execute before the script could reject it.
- name: Validate pull request title
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: node scripts/check-pr-title.mjs