|
1 |
| -# PR TaskList Completed Checker Action |
2 |
| -A GitHub action that checks if all tasks are completed in the pull requests. |
| 1 | +# WP Media PR Checklist Action |
| 2 | +A GitHub action that performs checks on PR descriptions, according to WP Media PR template from https://github.com/wp-media/.github. |
| 3 | + |
| 4 | +This action runs the following tests: |
| 5 | +- Description contains at least one text line that is not the one of the template. |
| 6 | +- Documentation contains at least one text line that is not one from the template. |
| 7 | +- At least one type of change is set. |
| 8 | +- All items in the checklist are ticked. |
3 | 9 |
|
4 | 10 | ## Usage
|
5 | 11 |
|
6 | 12 | ### Create a workflow
|
7 | 13 | ```yml
|
8 |
| -name: 'PR TaskList Completed Checker' |
| 14 | +name: 'PR Checklist' |
9 | 15 | on:
|
10 | 16 | pull_request:
|
11 | 17 | types: [edited, opened, synchronize, reopened]
|
12 | 18 |
|
13 | 19 | jobs:
|
14 |
| - task-check: |
| 20 | + pr-checklist: |
15 | 21 | runs-on: ubuntu-latest
|
16 | 22 | steps:
|
17 |
| - - uses: venkatsarvesh/pr-tasks-completed-action@v1.0.0 |
| 23 | + - uses: wp-media/pr-checklist-action@test/adaptation-to-WPMedia-template |
18 | 24 | with:
|
19 |
| - repo-token: "${{ secrets.GITHUB_TOKEN }}" |
| 25 | + repo-token: "${{ secrets.PR_CHECKLIST_TOKEN }}" |
20 | 26 | ```
|
21 | 27 |
|
22 |
| -### Check whether tasks are completed |
23 |
| -Add a pull request template to your repository (`.github/pull_request_template.md`). |
24 |
| - |
25 |
| -For example: |
26 |
| -```markdown |
27 |
| -## Checklist |
28 |
| -- [ ] Completed code review |
29 |
| -- [ ] Ran unit tests |
30 |
| -- [ ] Completed e2e tests |
31 |
| -``` |
32 |
| - |
33 |
| -Create a pull request that contained tasks list to your repository. This will start a workflow automatically to check whether tasks are completed. |
34 |
| - |
35 |
| -Every update on a pull request will start a new workflow automatically to check pending tasks. |
| 28 | +### Token |
36 | 29 |
|
37 |
| -All tasks completed: |
38 |
| - |
| 30 | +The PR_CHECKLIST_TOKEN must provide read access to Pull Requests of the repository this action is used in. |
39 | 31 |
|
40 |
| -Some tasks are still pending: |
| 32 | +### Making the check mandatory to merge |
41 | 33 |
|
42 |
| - |
| 34 | +Once the workflow file is commited, you can make the success mandatory before merging through branch protection: |
| 35 | +- Require status checks to pass before merging |
| 36 | + - Require branches to be up to date before merging |
| 37 | + - Search and select `pr-checklist` |
43 | 38 |
|
44 |
| -You can check a list of uncompleted tasks at the Actions page on clicking Details. |
45 |
| - |
| 39 | +## Build |
46 | 40 |
|
| 41 | +Modification to the sources must be done in the `src` folder. |
| 42 | +Once the changes are done, `run npm run build && npm run pack` to update the `lib` & `dist` folder. |
47 | 43 |
|
48 | 44 | ## :memo: Licence
|
49 |
| -MIT |
| 45 | +MIT |
0 commit comments