Drop ORO dependency in favor of Java regex #4197
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: Verify DONE checkboxes | |
| on: | |
| pull_request: | |
| types: [opened, edited, synchronize, reopened] | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| jobs: | |
| check-done-checkboxes: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Verify all DONE checkboxes are checked in a PR description | |
| uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 | |
| with: | |
| github-token: ${{ github.token }} | |
| script: | | |
| // We can't get this via context.payload.pull_request.body | |
| // as some pull_request status do not return the body | |
| // and in such cases the test runs but does not fail | |
| const prNumber = context.payload.pull_request.number; | |
| const { data: pr } = await github.rest.pulls.get({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| pull_number: prNumber | |
| }); | |
| const description = pr.body ?? ""; | |
| console.log(description) | |
| // ATM we are not checking if the number of | |
| // DONE checkboxes matches what the original template has | |
| const regex = /^\s*-\s*\[\s*\]\s*\**\s*done\s*\**\s*$/im; | |
| if (regex.test(description)) { | |
| core.setFailed('There is at least one unchecked DONE checkbox!'); | |
| } |