v5.43.0 #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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, ''); | |
| await github.rest.repos.updateRelease({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| release_id: release.id, | |
| body: body | |
| }); | |
| console.log("Release notes cleaned."); |