Skip to content

Commit 74239b3

Browse files
n24q02mclaude
andauthored
fix: let a fixed PR title clear the title gate (#959)
The title check ran only on opened/synchronize/reopened/ready_for_review, so editing the title -- the one thing the red check asks for -- produced no new run and the check kept reporting the old title. A gate whose own remedy does not clear it teaches people to silence it instead: #950, #952, #953 and #957 each independently proposed making the check skip for Sentinel:/Bolt:/Palette: titles, which are the exact titles it exists to catch. Moved to its own workflow so `edited` can be a trigger. It could not be one in ci.yml, where it would have re-run the whole lint/test matrix on every description change. This also drops the second, permanently skipped check of the same name that ci.yml's pull_request_target trigger left on every PR. Ports mcp-core#718, keeping this repo's pinned harden-runner SHA. Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
1 parent f693e9f commit 74239b3

2 files changed

Lines changed: 61 additions & 38 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -27,44 +27,8 @@ permissions:
2727
pull-requests: write
2828

2929
jobs:
30-
# ============================================================================
31-
# PR Title Lint (Conventional Commits subset)
32-
# ============================================================================
33-
# Squash-merge uses the PR title as the commit subject and bypasses the
34-
# local enforce-commit pre-commit commit-msg hook (bot PRs never run local
35-
# git hooks). Without a server-side check, a bot title like
36-
# "Sentinel: [HIGH] Fix ..." squash-merges with a non-conventional subject
37-
# -> PSR's commit parser silently ignores it -> no version bump, even for a
38-
# security fix. This job only surfaces a red check; it does not block
39-
# merge (no required-status-check rule), so the person merging still must
40-
# retype the squash-commit subject to start with fix:/feat: when this is red.
41-
pr-title:
42-
name: Validate PR title (Conventional Commits subset)
43-
if: github.event_name == 'pull_request'
44-
runs-on: ubuntu-latest
45-
permissions:
46-
pull-requests: read
47-
steps:
48-
- name: Harden Runner
49-
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
50-
with:
51-
egress-policy: audit
52-
53-
- uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1
54-
env:
55-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56-
with:
57-
# Repo rule: only feat: and fix: (feedback_commit_prefix.md). This is
58-
# narrower than PSR's own default allowed_tags (which also treats
59-
# perf: as patch-worthy) -- we enforce the project convention here,
60-
# not just what PSR itself would accept.
61-
types: |
62-
fix
63-
feat
64-
requireScope: false
65-
subjectPattern: ^(?![A-Z]).+$
66-
subjectPatternError: |
67-
The subject must not start with an uppercase character.
30+
# PR title validation lives in pr-title.yml -- it needs the `edited` trigger,
31+
# which would re-run this whole matrix on every description change.
6832

6933
lint-and-test:
7034
name: Lint & Test (Python ${{ matrix.python-version }}, ${{ matrix.os }})

.github/workflows/pr-title.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: PR Title
2+
3+
# Squash-merge uses the PR title as the commit subject and bypasses the local
4+
# enforce-commit pre-commit commit-msg hook (bot PRs never run local git
5+
# hooks). Without a server-side check, a bot title like
6+
# "Sentinel: [HIGH] Fix ..." squash-merges with a non-conventional subject ->
7+
# PSR's commit parser silently ignores it -> no version bump, even for a
8+
# security fix. This job only surfaces a red check; it does not block merge (no
9+
# required-status-check rule), so the person merging still must retype the
10+
# squash-commit subject to start with fix:/feat: when this is red.
11+
#
12+
# It lives in its own workflow so that `edited` can be a trigger. In ci.yml it
13+
# could not: `edited` fires on every title and description change, and there it
14+
# would have re-run the whole lint/test matrix each time. Without `edited` the
15+
# check was unclearable -- fixing the title, which is exactly what the red
16+
# check asks for, produced no new run, so the check kept reporting the old
17+
# title forever. A gate whose own remedy does not clear it teaches people to
18+
# ignore it, or to silence it: #950, #952, #953 and #957 each independently
19+
# proposed making this check skip for bot-prefixed titles, which are the exact
20+
# titles it exists to catch.
21+
#
22+
# ci.yml also listens on pull_request_target, where this job's `if` left a
23+
# second, permanently skipped check of the same name on every PR.
24+
25+
on:
26+
pull_request:
27+
branches: [main]
28+
types: [opened, edited, synchronize, reopened, ready_for_review]
29+
30+
permissions:
31+
contents: read
32+
33+
jobs:
34+
pr-title:
35+
name: Validate PR title (Conventional Commits subset)
36+
runs-on: ubuntu-latest
37+
permissions:
38+
pull-requests: read
39+
steps:
40+
- name: Harden Runner
41+
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
42+
with:
43+
egress-policy: audit
44+
45+
- uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
with:
49+
# Repo rule: only feat: and fix: (feedback_commit_prefix.md). This is
50+
# narrower than PSR's own default allowed_tags (which also treats
51+
# perf: as patch-worthy) -- we enforce the project convention here,
52+
# not just what PSR itself would accept.
53+
types: |
54+
fix
55+
feat
56+
requireScope: false
57+
subjectPattern: ^(?![A-Z]).+$
58+
subjectPatternError: |
59+
The subject must not start with an uppercase character.

0 commit comments

Comments
 (0)