SAT-20386 Jira card is closed; removing it. #5688
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: Remove the PRT label, for the new commit | |
| on: | |
| pull_request_target: | |
| types: ["synchronize"] | |
| jobs: | |
| prt_labels_remover: | |
| name: remove the PRT label when amendments or new commits added to PR | |
| runs-on: ubuntu-latest | |
| if: "(contains(github.event.pull_request.labels.*.name, 'PRT-Passed'))" | |
| steps: | |
| - name: remove the PRT Passed label, for new commit | |
| uses: actions/github-script@v8 | |
| with: | |
| github-token: ${{ secrets.CHERRYPICK_PAT }} | |
| script: | | |
| const prNumber = '${{ github.event.number }}'; | |
| const issue = await github.rest.issues.get({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: prNumber, | |
| }); | |
| const labelsToRemove = ['PRT-Passed']; | |
| const labelsToRemoveFiltered = labelsToRemove.filter(label => issue.data.labels.some(({ name }) => name === label)); | |
| if (labelsToRemoveFiltered.length > 0) { | |
| await Promise.all(labelsToRemoveFiltered.map(async label => { | |
| await github.rest.issues.removeLabel({ | |
| issue_number: prNumber, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| name: label | |
| }); | |
| })); | |
| } |