From 78ef3e0d3fa81ef7e2508db639dd0e3c6435d0f1 Mon Sep 17 00:00:00 2001 From: ezilber-akamai Date: Tue, 31 Mar 2026 11:10:29 -0400 Subject: [PATCH 1/3] Added PR title checking to lint workflow and clean up release notes --- .github/workflows/clean-release-notes.yml | 35 +++++++++++++++++++++ .github/workflows/validate-pr-title.yml | 38 +++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 .github/workflows/clean-release-notes.yml create mode 100644 .github/workflows/validate-pr-title.yml diff --git a/.github/workflows/clean-release-notes.yml b/.github/workflows/clean-release-notes.yml new file mode 100644 index 0000000..52ea10f --- /dev/null +++ b/.github/workflows/clean-release-notes.yml @@ -0,0 +1,35 @@ +name: 'Validate PR Title' +on: + pull_request: + +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 + 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 }} diff --git a/.github/workflows/validate-pr-title.yml b/.github/workflows/validate-pr-title.yml new file mode 100644 index 0000000..e1a4d5b --- /dev/null +++ b/.github/workflows/validate-pr-title.yml @@ -0,0 +1,38 @@ +name: Clean Release Notes + +on: + release: + types: [published] + +jobs: + clean-release-notes: + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - name: Remove ticket prefixes from release notes + uses: actions/github-script@v7 + with: + script: | + const release = context.payload.release; + + let body = release.body; + + if (!body) { + console.log("Release body empty, nothing to clean."); + return; + } + + // Remove ticket prefixes like "TPT-1234: " or "TPT-1234:" + body = body.replace(/TPT-\d+:\s*/g, ''); + + await github.rest.repos.updateRelease({ + owner: context.repo.owner, + repo: context.repo.repo, + release_id: release.id, + body: body + }); + + console.log("Release notes cleaned."); + \ No newline at end of file From 7d1e9fbc442e4e38692d3da5c779371b45121943 Mon Sep 17 00:00:00 2001 From: ezilber-akamai Date: Tue, 31 Mar 2026 14:14:17 -0400 Subject: [PATCH 2/3] Swap workflows oops --- .github/workflows/clean-release-notes.yml | 59 ++++++++++++----------- .github/workflows/validate-pr-title.yml | 59 +++++++++++------------ 2 files changed, 59 insertions(+), 59 deletions(-) diff --git a/.github/workflows/clean-release-notes.yml b/.github/workflows/clean-release-notes.yml index 52ea10f..e1a4d5b 100644 --- a/.github/workflows/clean-release-notes.yml +++ b/.github/workflows/clean-release-notes.yml @@ -1,35 +1,38 @@ -name: 'Validate PR Title' +name: Clean Release Notes + on: - pull_request: + release: + types: [published] jobs: - validate-pr-title: + clean-release-notes: runs-on: ubuntu-latest permissions: - contents: read - pull-requests: read + contents: write + 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 + - name: Remove ticket prefixes from release notes + uses: actions/github-script@v7 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 }} + script: | + const release = context.payload.release; + + let body = release.body; + + if (!body) { + console.log("Release body empty, nothing to clean."); + return; + } + + // Remove ticket prefixes like "TPT-1234: " or "TPT-1234:" + body = body.replace(/TPT-\d+:\s*/g, ''); + + await github.rest.repos.updateRelease({ + owner: context.repo.owner, + repo: context.repo.repo, + release_id: release.id, + body: body + }); + + console.log("Release notes cleaned."); + \ No newline at end of file diff --git a/.github/workflows/validate-pr-title.yml b/.github/workflows/validate-pr-title.yml index e1a4d5b..52ea10f 100644 --- a/.github/workflows/validate-pr-title.yml +++ b/.github/workflows/validate-pr-title.yml @@ -1,38 +1,35 @@ -name: Clean Release Notes - +name: 'Validate PR Title' on: - release: - types: [published] + pull_request: jobs: - clean-release-notes: + validate-pr-title: runs-on: ubuntu-latest permissions: - contents: write - + contents: read + pull-requests: read steps: - - name: Remove ticket prefixes from release notes - uses: actions/github-script@v7 + # 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: - script: | - const release = context.payload.release; - - let body = release.body; - - if (!body) { - console.log("Release body empty, nothing to clean."); - return; - } - - // Remove ticket prefixes like "TPT-1234: " or "TPT-1234:" - body = body.replace(/TPT-\d+:\s*/g, ''); - - await github.rest.repos.updateRelease({ - owner: context.repo.owner, - repo: context.repo.repo, - release_id: release.id, - body: body - }); - - console.log("Release notes cleaned."); - \ No newline at end of file + 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 }} From dfa34d69e5269bbff47eb843ea451e847f0e4e9d Mon Sep 17 00:00:00 2001 From: ezilber-akamai Date: Wed, 1 Apr 2026 09:30:30 -0400 Subject: [PATCH 3/3] Bumped actions/github-script from v7 to v8 --- .github/workflows/clean-release-notes.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/clean-release-notes.yml b/.github/workflows/clean-release-notes.yml index e1a4d5b..ca2c3cd 100644 --- a/.github/workflows/clean-release-notes.yml +++ b/.github/workflows/clean-release-notes.yml @@ -12,7 +12,7 @@ jobs: steps: - name: Remove ticket prefixes from release notes - uses: actions/github-script@v7 + uses: actions/github-script@v8 with: script: | const release = context.payload.release;