|
| 1 | +--- |
| 2 | +name: Review Checklist |
| 3 | + |
| 4 | +on: |
| 5 | + pull_request_target: |
| 6 | + types: [opened, review_requested] |
| 7 | + |
| 8 | +jobs: |
| 9 | + review-checklist: |
| 10 | + name: Review Checklist |
| 11 | + runs-on: ubuntu-latest |
| 12 | + steps: |
| 13 | + - uses: actions/github-script@v7 |
| 14 | + with: |
| 15 | + script: | |
| 16 | + const body = context.payload.pull_request.body |
| 17 | + if (body && body.startsWith(":robot: I have created a release *beep* *boop*")) { return; } |
| 18 | +
|
| 19 | + const { data: comments } = await github.rest.issues.listComments({ |
| 20 | + issue_number: context.issue.number, |
| 21 | + owner: context.repo.owner, |
| 22 | + repo: context.repo.repo, |
| 23 | + }); |
| 24 | +
|
| 25 | + // if comment already exists, then just return |
| 26 | + if (comments.find(comment => comment.body.includes("### Review Checklist"))) { return; } |
| 27 | +
|
| 28 | + github.rest.issues.createComment({ |
| 29 | + issue_number: context.issue.number, |
| 30 | + owner: context.repo.owner, |
| 31 | + repo: context.repo.repo, |
| 32 | + body: `### Review Checklist |
| 33 | +
|
| 34 | + Does this PR follow the [Contribution Guidelines](https://github.com/mrcjkb/haskell-snippets.nvim/blob/master/CONTRIBUTING.md)? Following is a _partial_ checklist: |
| 35 | +
|
| 36 | + Proper [conventional commit](https://www.conventionalcommits.org/en/v1.0.0/) scoping: |
| 37 | +
|
| 38 | + - For example, fix(lsp): some lsp-related bugfix |
| 39 | +
|
| 40 | + - [ ] Pull request title has the appropriate conventional commit prefix. |
| 41 | +
|
| 42 | + If applicable: |
| 43 | +
|
| 44 | + - [ ] Tested |
| 45 | + - [ ] Tests have been added. |
| 46 | + - [ ] Tested manually (Steps to reproduce in PR description). |
| 47 | + - [ ] Updated documentation. |
| 48 | + - [ ] Updated [CHANGELOG.md](https://github.com/mrcjkb/haskell-snippets.nvim/blob/master/CHANGELOG.md) |
| 49 | + `, |
| 50 | + }) |
0 commit comments