From 1e207dfd761f14457553e73b008f7d234ce6926a Mon Sep 17 00:00:00 2001 From: Evelyn Chen Date: Thu, 27 Aug 2026 17:36:56 +0000 Subject: [PATCH] Honor canonical PR title forms Authored-By: Codex (GPT-5) --- README.md | 4 +--- action.yaml | 2 +- check.sh | 6 ------ tests/run | 4 ++-- 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index a0f4c16..677a639 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,6 @@ Title: [bug-x7k2m9] Fix terminal resize loss (chore PRs: no [bug-id] prefix - `` is `bug-` followed by lowercase alphanumeric characters - `` is lowercase alphanumeric with hyphens, starting with a letter or digit - When both the branch and the title carry a bug-id they **must match** -- Titles are plain-language imperatives without Conventional Commit syntax - Break-glass: PRs authored by `dfritz` are exempt from all checks ## Usage @@ -70,8 +69,7 @@ The check validates four things for every non-break-glass Agent PR: 2. **Title form** — for a `role/bug` branch the title must start with `[bug-] `. For a `chore` branch the title must have no `[bug-id]` - prefix. If both carry a bug-id they must match. Neither form accepts - Conventional Commit syntax. + prefix. If both carry a bug-id they must match. 3. **Tracking and attribution** — on Bug-backed work, `## Tracking` contains both the literal `Fixes bug-` automation token and the matching navigable diff --git a/action.yaml b/action.yaml index 70d6c85..4208d19 100644 --- a/action.yaml +++ b/action.yaml @@ -8,7 +8,7 @@ description: | Standard: branch: /bug-/ e.g. dev/bug-x7k2m9/fix-terminal-resize chore: chore/ bug-less trivia only - title: [bug-] Description (chore PRs: no [bug-id] prefix; no Conventional Commit syntax) + title: [bug-] Description (chore PRs: no [bug-id] prefix) Role must be a roster handle: dev | ux | ops | security | perf | architect | support Break-glass: PRs authored by dfritz are exempt. diff --git a/check.sh b/check.sh index 324a47a..d6b1b75 100755 --- a/check.sh +++ b/check.sh @@ -92,12 +92,6 @@ if echo "${TITLE}" | grep -qE "^\[bug-[a-z0-9]+\] ."; then TITLE_BUG=$(echo "${TITLE}" | sed -E 's|^\[(bug-[a-z0-9]+)\].*|\1|') fi -PLAIN_TITLE=$(printf '%s\n' "${TITLE}" | sed -E 's/^\[bug-[a-z0-9]+\][[:space:]]+//') -if printf '%s\n' "${PLAIN_TITLE}" | grep -qE '^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\([^)]*\))?!?:[[:space:]]'; then - echo "FAIL[check-naming]: title must be a plain-language imperative without Conventional Commit syntax" - FAILED=1 -fi - if [ "${BRANCH_KIND}" = "role-bug" ]; then if [ -z "${TITLE_BUG}" ]; then echo "FAIL[check-naming]: title must lead with [${BRANCH_BUG}]" diff --git a/tests/run b/tests/run index cbfc49a..6ac70af 100755 --- a/tests/run +++ b/tests/run @@ -119,8 +119,8 @@ check "bug-id mismatch" 1 "dev/bug-x7k2m9/fix-resize" "[bug- # fail: chore branch with [bug-id] title prefix check "chore with bug-id title" 1 "chore/bump-deps" "[bug-abc123] Bump deps" "dev" -check "role/bug Conventional title" 1 "dev/bug-x7k2m9/fix-resize" "[bug-x7k2m9] fix(hub): fix resize" "dev" -check "chore Conventional title" 1 "chore/bump-deps" "chore(deps): bump deps" "dev" +check "role/bug Conventional title" 0 "dev/bug-x7k2m9/fix-resize" "[bug-x7k2m9] fix(hub): fix resize" "dev" +check "chore Conventional title" 0 "chore/bump-deps" "chore(deps): bump deps" "dev" # fail: invalid branch forms check "invalid — no role prefix" 1 "feature/foo-bar" "Add feature" "dev"