From 2c00aeb12dbb68269e8ab310a45a2f2736168945 Mon Sep 17 00:00:00 2001 From: Zhiwei Liang Date: Thu, 3 Dec 2026 17:59:17 -0500 Subject: [PATCH] TPT-4845: Rerun PR title validation on edits Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/ci.yml | 25 ----------------- .github/workflows/validate-pr-title.yml | 36 +++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/validate-pr-title.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b83380aec..882445780 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,31 +16,6 @@ jobs: contents: read pull-requests: read steps: - # Enforce TPT-1234: prefix on PR titles, with the following exemptions: - # - PRs labeled 'dependencies' (e.g. Dependabot PRs) - # - PRs labeled 'hotfix' (urgent fixes that may not have a ticket) - # - PRs labeled 'community-contribution' (external contributors without TPT tickets) - # - PRs labeled 'ignore-for-release' (release PRs that don't need a ticket prefix) - - name: Validate PR Title - if: github.event_name == 'pull_request' - uses: amannn/action-semantic-pull-request@v6 - with: - types: | - TPT-\d+ - requireScope: false - # Override the default header pattern to allow hyphens and digits in the type - # (e.g. "TPT-4298: Description"). The default pattern only matches word - # characters (\w) which excludes hyphens. - headerPattern: '^([\w-]+):\s?(.*)$' - headerPatternCorrespondence: type, subject - ignoreLabels: | - dependencies - hotfix - community-contribution - ignore-for-release - env: - GITHUB_TOKEN: ${{ github.token }} - - name: checkout repo uses: actions/checkout@v7 diff --git a/.github/workflows/validate-pr-title.yml b/.github/workflows/validate-pr-title.yml new file mode 100644 index 000000000..2876fa3aa --- /dev/null +++ b/.github/workflows/validate-pr-title.yml @@ -0,0 +1,36 @@ +name: Validate PR Title + +on: + pull_request: + types: [opened, synchronize, reopened, edited, labeled, unlabeled] + +jobs: + validate-pr-title: + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: read + steps: + # Enforce TPT-1234: prefix on PR titles, with the following exemptions: + # - PRs labeled 'dependencies' (e.g. Dependabot PRs) + # - PRs labeled 'hotfix' (urgent fixes that may not have a ticket) + # - PRs labeled 'community-contribution' (external contributors without TPT tickets) + # - PRs labeled 'ignore-for-release' (release PRs that don't need a ticket prefix) + - name: Validate PR Title + uses: amannn/action-semantic-pull-request@v6 + with: + types: | + TPT-\d+ + requireScope: false + # Override the default header pattern to allow hyphens and digits in the type + # (e.g. "TPT-4298: Description"). The default pattern only matches word + # characters (\w) which excludes hyphens. + headerPattern: '^([\w-]+):\s?(.*)$' + headerPatternCorrespondence: type, subject + ignoreLabels: | + dependencies + hotfix + community-contribution + ignore-for-release + env: + GITHUB_TOKEN: ${{ github.token }}