TPT-4298: Added PR title checking workflow and clean up release notes workflow#92
Conversation
There was a problem hiding this comment.
Pull request overview
Adds GitHub Actions automation to enforce Jira-style PR titles and to post-process published release notes by stripping ticket prefixes, improving consistency in PR metadata and readability of release notes.
Changes:
- Introduces a PR-title validation workflow intended to enforce
TPT-1234:prefixes (with label-based exemptions). - Introduces a release-published workflow that edits release notes to remove
TPT-####:prefixes.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| .github/workflows/validate-pr-title.yml | New workflow to validate PR title format/prefix and ignore certain labeled PRs. |
| .github/workflows/clean-release-notes.yml | New workflow to update published release notes by removing ticket prefixes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| 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?(.*)$' |
There was a problem hiding this comment.
amannn/action-semantic-pull-request treats types as a set of literal allowed type strings (e.g. feat, fix), not a regex. With types: TPT-\d+, a real PR title like TPT-4298: ... will not match and the check will fail for every PR. Consider switching to a regex-based title check (e.g., via actions/github-script) or configure the action so the regex itself validates the prefix (and avoid relying on types for dynamic ticket IDs).
| 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?(.*)$' | |
| requireScope: false | |
| # Enforce PR titles of the form "TPT-1234: Description" by requiring | |
| # a TPT-<digits> prefix followed by a colon and a subject. | |
| headerPattern: '^(TPT-\d+):\s?(.*)$' |
| // Remove ticket prefixes like "TPT-1234: " or "TPT-1234:" | ||
| body = body.replace(/TPT-\d+:\s*/g, ''); |
There was a problem hiding this comment.
The replacement regex /TPT-\d+:\s*/g will remove ticket strings anywhere in the release body, not just at the start of patch-note lines. This can unintentionally alter prose, code blocks, or references that legitimately mention a ticket ID mid-sentence. If the intent is to strip only line/item prefixes, anchor the match to the start of each line (multiline) and optionally allow common bullet prefixes (e.g. -, *, whitespace) so only patch-note entries are modified.
| // 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:" at the start of list lines | |
| body = body.replace(/^[\s*-]*TPT-\d+:\s*/gm, ''); |
📝 Description
Added a new workflow to fail if the PR title does not begin with "TPT-1234:" (works with and without a space between the colon and description).
Also added a new workflow to run upon release publish to edit the release notes to remove the Jira ticket ID prefixes from patch notes.
✔️ How to Test
To test the PR title enforcement, edit the title of this PR to remove the Jira ticket ID and rerun the pr title validation job. It should fail immediately. Then, add the Jira ticket ID back to the PR title and it should pass.
To test the release note cleanup job, check out this PR locally and merge it into your fork. Then, cut a test release to your fork. Upon generating the release notes, the TPT-**** prefix will still be there. Publish the release and verify that the new workflow is triggered. After it finishes, confirm that the release notes were correctly updated.