Skip to content

Commit 4472f11

Browse files
niukuochzblych
andauthored
[TRTLLM-6364][infra] Validate for PR titles to ensure they follow the required format (#6278)
Signed-off-by: Yiteng Niu <[email protected]> Co-authored-by: Yanchao Lu <[email protected]>
1 parent 942e080 commit 4472f11

File tree

2 files changed

+67
-6
lines changed

2 files changed

+67
-6
lines changed

.github/pull_request_template.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,21 @@
33
<!--
44
Please write the PR title by following this template:
55
6-
[JIRA ticket/NVBugs ID/GitHub issue][fix/feat/doc/infra/...] \<summary of this PR\>
6+
**[JIRA ticket/NVBugs ID/GitHub issue/None][type] Summary**
77
8-
For example, assume I have a PR to support a new feature about cache manager for JIRA ticket TRTLLM-1000, it would be like:
8+
Valid ticket formats:
9+
- JIRA ticket: [TRTLLM-1234] or [FOOBAR-123] for other FOOBAR project
10+
- NVBugs ID: [https://nvbugs/1234567]
11+
- GitHub issue: [#1234]
12+
- No ticket: [None]
913
10-
[TRTLLM-1000][feat] Support a new feature about cache manager
14+
Valid types (lowercase): [fix], [feat], [doc], [infra], [chore], etc.
1115
12-
Or I have a PR to fix a Llama3 accuracy issue:
13-
14-
[https://nvbugs/1234567][fix] Fix Llama3 accuracy issue
16+
Examples:
17+
- [TRTLLM-1234][feat] Add new feature
18+
- [https://nvbugs/1234567][fix] Fix some bugs
19+
- [#1234][doc] Update documentation
20+
- [None][chore] Minor clean-up
1521
-->
1622

1723
## Description

.github/workflows/pr-check.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
name: PR Checks
17+
18+
on:
19+
pull_request:
20+
types: [opened, edited, synchronize, reopened]
21+
22+
jobs:
23+
check-pr-title:
24+
name: Check PR Title Format
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Validate PR Title Format
28+
id: check-pr-title
29+
uses: agenthunt/[email protected]
30+
continue-on-error: true
31+
with:
32+
pr-title-regex: "^(\\[(None|[A-Z0-9]+-[0-9]+|#[0-9]+|https:\\/\\/nvbugs\\/[0-9]+)\\])(\\[[a-z0-9]+\\]) (([^ ].*)?[^ ])$"
33+
pr-body-regex: ""
34+
35+
- name: PR Title Format Guide
36+
if: steps.check-pr-title.outcome == 'failure'
37+
run: |
38+
echo "::error::PR title format check failed."
39+
echo "Expected PR title format:"
40+
echo " [JIRA ticket/NVBugs ID/GitHub issue/None][type] Summary"
41+
echo ""
42+
echo "Valid ticket formats:"
43+
echo " - JIRA ticket: [TRTLLM-1234] or [FOOBAR-123] for other FOOBAR project"
44+
echo " - NVBugs ID: [https://nvbugs/1234567]"
45+
echo " - GitHub issue: [#1234]"
46+
echo " - No ticket: [None]"
47+
echo ""
48+
echo "Valid types (lowercase): [fix], [feat], [doc], [infra], [chore], etc."
49+
echo ""
50+
echo "Examples:"
51+
echo " - [TRTLLM-1234][feat] Add new feature"
52+
echo " - [https://nvbugs/1234567][fix] Fix some bugs"
53+
echo " - [#1234][doc] Update documentation"
54+
echo " - [None][chore] Minor clean-up"
55+
exit 1

0 commit comments

Comments
 (0)