Skip to content

chore: validate pull request titles - #50

Closed
chaim0m wants to merge 1 commit into
mainfrom
codex/CMP-48969-pr-title-validation
Closed

chore: validate pull request titles#50
chaim0m wants to merge 1 commit into
mainfrom
codex/CMP-48969-pr-title-validation

Conversation

@chaim0m

@chaim0m chaim0m commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • validate human-authored pull request titles against Conventional Commits
  • use the same pinned semantic-title action as Omni
  • run when a pull request is opened, edited, synchronized, or reopened
  • skip bot-authored pull requests

Jira: https://doitintl.atlassian.net/browse/CMP-48969

Why

dci-cli release notes are generated from commit titles, and the repository already expects conventional prefixes such as feat:, fix:, and chore:. Validating the PR title catches inconsistent squash or rebase titles before merge.

Test methods

  • parsed the workflow as YAML
  • ran git diff --check
  • verified the pinned action revision matches Omni
  • verified the workflow uses read-only permissions and does not check out pull request code
  • GitHub CI on this pull request

After merge, open or edit a human-authored PR with a non-conventional title to see the check fail, then change it to a title such as chore: test title validation to see it pass.

Could this break things?

Risk: low. This adds a required-looking check but does not change repository branch protection by itself. Existing open PRs may get validated the next time their title or commits change. Bot-authored PRs are skipped.

@apgiorgi apgiorgi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This doesn't do what it claims, and the validation list contradicts our conventions.

1. The premise is wrong for this repo.

We're rebase-merge only — allow_squash_merge: false, allow_merge_commit: false, allow_rebase_merge: true. The PR title never becomes a commit message; individual commits land verbatim. GoReleaser's changelog filters operate on commit subjects (.goreleaser.yaml:73-82), so a validated PR title has zero effect on release notes.

The PR body's rationale — "catches inconsistent squash or rebase titles" — doesn't apply here. If we want to enforce prefixes for changelog purposes, the thing to validate is commit messages, not the title. validateSingleCommit is the only knob in this action that touches them, and it's unused.

2. The allowed-prefix list doesn't match AGENTS.md.

pr-title.yml:17-21 sets no types:, so the action falls back to defaultTypes (src/validatePrTitle.js:7,22 at the pinned SHA): feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert. AGENTS.md documents only docs:, test:, chore: as filtered, plus fix: and feat:.

Consequence: style:, refactor:, perf:, build:, ci:, revert: all pass validation but are not in the .goreleaser.yaml:77-82 exclude list, so they'd leak straight into user-facing release notes. A gate that green-lights prefixes we don't use is worse than no gate. Needs an explicit types: of exactly the five.

3. pull_request_target (pr-title.yml:4) is unnecessary. No checkout, no write permissions, no secrets beyond GITHUB_TOKEN — plain pull_request suffices and matches house style (ci.yml:3). Same precedent concern as #48: a later edit adding actions/checkout of the PR head turns this into fork-controlled code running with the base-repo token.

It also means this workflow never ran on its own PR — pull_request_target loads the workflow from main, and there's no validate-title check in gh pr checks 50, contradicting "GitHub CI on this pull request" in the body.

Nits

  • Permissions are otherwise least-privilege; pull-requests: read is arguably unneeded too.
  • Action is pinned to v5.5.3 (2024-06-28, node20); current is v6.1.1. No known vuln, just a stale major with no dependabot to bump it.
  • pr-title.yml:13 if: user.type == 'User' — if this ever becomes a required check, bot PRs report skipped. Worth confirming that's intended.
  • requireScope: false (:21) is already the default; synchronize (:5) can't change a title.

Structurally identical to #48 and #51. If we want any of this, one pr-hygiene.yml with three jobs beats three files. And per CONTRIBUTING.md, changes to repo surface like this want an issue first.

@chaim0m

chaim0m commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator Author

Closing this after validating the review finding. This repository is rebase-merge-only, so PR titles do not become commit subjects and cannot control GoReleaser changelog entries. The proposed allowed types also did not match the repository’s release filters. A future check, if needed, should validate commits themselves and be scoped as a separate task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants