|
| 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 | + |
| 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