Skip to content

ci: add PR validation check for type label or Conventional Commits title#423

Merged
jkmassel merged 7 commits intotrunkfrom
jkmassel/add-changelog
Apr 15, 2026
Merged

ci: add PR validation check for type label or Conventional Commits title#423
jkmassel merged 7 commits intotrunkfrom
jkmassel/add-changelog

Conversation

@jkmassel
Copy link
Copy Markdown
Contributor

@jkmassel jkmassel commented Apr 3, 2026

Summary

  • Add a required status check (validate-pr.yml) that fails if a PR has neither a valid Conventional Commits title prefix nor a [Type] label

This closes the gap where PRs without a recognized prefix (e.g. "Move editor loading into the library") silently skip auto-labeling and fall through the cracks in release notes. With this check, every PR is guaranteed to be categorized — including breaking changes.

Test plan

  • Open a PR with a valid prefix (e.g. feat: test) — check should pass
  • Open a PR without a prefix (e.g. "Test PR") — check should fail
  • Manually add a [Type] label to the failing PR — check should re-run and pass
  • After merge, add as a required status check in branch protection settings

Add a CHANGELOG.md following the release-toolkit format with historical
entries back to v0.3.0. Each version is categorized into Breaking Changes,
New Features, Bug Fixes, and Internal Changes.

The release script now automatically manages the Trunk section during
releases, and the developer workflow docs mention updating the changelog
when merging user-facing changes.
@github-actions github-actions bot added the [Type] Developer Documentation Documentation for developers label Apr 3, 2026
@dcalhoun
Copy link
Copy Markdown
Member

dcalhoun commented Apr 6, 2026

With #392, I attempted to automate change groups and avoid the need to manually type change log entries, including breaking changes. If a PR is labeled appropriately, its title is included in the GitHub Release notes in the corresponding group. If a PR title follows Conventional Commits spec, a GitHub Action automatically labels the PR appropriately. I.e., the PR title becomes the release note.

Curious your thoughts: Is there value in a CHANGELOG.md over GitHub Releases? PR titles are required for the GitHub flow, is there value in also having separate release note entries? If both are worth keeping, we might consider ensuring manual notes are never forgotten via scripts like Jetpack's. Lasly, should we align the CHANGELOG.md organization with the existing GitHub Release organization or remove the latter?

Address review feedback — the comprehensive per-PR lists are redundant
with the auto-generated GitHub Release notes from #392. The CHANGELOG
now focuses exclusively on breaking changes, which is the one thing
GitHub Releases can't surface ahead of time via the Trunk staging area.
Ensures every PR has either a valid Conventional Commits prefix in the
title (which triggers automatic labeling via label-pr.yml) or a manually
applied [Type] label. This prevents PRs from falling through the cracks
in auto-generated release notes.
The label-pr workflow already applies the [Type] Breaking Change label
when it sees ! in the title — no need to warn about it separately.
The new PR validation check ensures every PR has either a Conventional
Commits title or a type label, so GitHub Releases will reliably capture
breaking changes going forward. A manual CHANGELOG is redundant.
@jkmassel jkmassel force-pushed the jkmassel/add-changelog branch from ad65bde to 75f39ed Compare April 13, 2026 21:47
@jkmassel jkmassel changed the title docs: add CHANGELOG.md with breaking change tracking ci: add PR validation check for type label or Conventional Commits title Apr 13, 2026
@jkmassel jkmassel requested a review from oguzkocer April 13, 2026 21:55
@jkmassel jkmassel self-assigned this Apr 13, 2026
@jkmassel jkmassel marked this pull request as ready for review April 13, 2026 21:55
Copy link
Copy Markdown
Contributor

@oguzkocer oguzkocer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried testing this with #454 & #455 but I don't think it worked. I branched out of jkmassel/add-changelog and opened the PRs against it as I don't see anything in the config about it needing to be against trunk. Did I miss something?

pull_request_target only runs the workflow from the default branch, so
the check can't fire until it's merged — a chicken-and-egg problem.

This workflow only needs read access (title + labels), so pull_request
is the correct trigger. pull_request_target is only needed for the
label-pr workflow which writes labels.
@jkmassel
Copy link
Copy Markdown
Contributor Author

@oguzkocer – sorry about that. I fixed the issue and rebase your test PRs atop this one. They now pass/fail as expected.

Copy link
Copy Markdown
Contributor

@oguzkocer oguzkocer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. Claude brought up some considerations as shared below, but I don't think they are blocking. I'll leave it to you whether these are worth doing and it should be done in this PR.

Claude's review

  1. Breaking change detection is captured but unused. isBreaking is computed (line 29) but never referenced again. If it's intended for future use, I'd remove it now to avoid dead code — it can be re-added when needed. If it's supposed to do something (like warn or require a [Type] Breaking Change label), that logic is missing.

  2. style prefix is included but has no corresponding [Type] label. If someone uses style: in their title, the check passes, but the auto-labeler (presumably) won't assign a type label. Is that intentional? Same question for chore: — is there a label mapping for it?

  3. typeLabels list doesn't include all label categories. For example, there's no [Type] Code Style or [Type] Chore in the array. If those labels exist, PRs with them wouldn't be recognized by this check. If they don't exist, then the style and chore prefixes pass validation but can't be categorized by label alone.

@jkmassel jkmassel force-pushed the jkmassel/add-changelog branch from f2e2a03 to f8e2aaa Compare April 15, 2026 20:27
Force-pushes (e.g. rebases) fire the synchronize event, not opened or
edited. Without this, the check wouldn't re-run after a rebase.
@jkmassel jkmassel force-pushed the jkmassel/add-changelog branch from f8e2aaa to aeb020d Compare April 15, 2026 20:28
@jkmassel
Copy link
Copy Markdown
Contributor Author

The chore: and style: ones are dropped from release notes, so it should be fine. Thanks for flagging!

@jkmassel jkmassel enabled auto-merge (squash) April 15, 2026 20:30
@jkmassel jkmassel merged commit 3d39d5c into trunk Apr 15, 2026
17 checks passed
@jkmassel jkmassel deleted the jkmassel/add-changelog branch April 15, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Developer Documentation Documentation for developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants