Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/clean-release-notes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
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@v8
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, '');
Comment on lines +27 to +28
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cleanup regex /TPT-\d+:\s*/g will remove ticket patterns anywhere in the release body, not just as a prefix to a bullet/line. If the intent is specifically to strip leading ticket IDs from generated patch notes, consider anchoring the match to the start of each line (and optionally common bullet prefixes) using multiline mode so you don't accidentally alter references in the middle of sentences or links.

Suggested change
// Remove ticket prefixes like "TPT-1234: " or "TPT-1234:"
body = body.replace(/TPT-\d+:\s*/g, '');
// Remove ticket prefixes like "TPT-1234: " or "TPT-1234:" when they appear at the start of a line (optionally after bullet markers)
body = body.replace(/^[\s>*-]*TPT-\d+:\s*/gm, '');

Copilot uses AI. Check for mistakes.

await github.rest.repos.updateRelease({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: release.id,
body: body
});

console.log("Release notes cleaned.");
27 changes: 27 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,34 @@ jobs:
test:
name: Run tests
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
Comment on lines +18 to +22
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

amannn/action-semantic-pull-request@v6 validates the parsed type against an allow-list; the types input is treated as exact values (type-enum), not a regex. With types: TPT-\d+, PR titles like TPT-4298: ... will not match and this step will fail for every non-ignored PR. Consider replacing this with a simple regex check on github.event.pull_request.title (e.g., via actions/github-script or a run: step) and keep the label-based exemptions there.

Copilot uses AI. Check for mistakes.
# 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 }}
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
Expand Down
Loading