Skip to content

Commit 62798c4

Browse files
Merge pull request #1 from wp-media/test/adaptation-to-WPMedia-template
Initial adaptation to WP Media template
2 parents 2ea30c6 + 068e1f7 commit 62798c4

9 files changed

+8642
-7976
lines changed

README.md

+23-27
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,45 @@
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.
39

410
## Usage
511

612
### Create a workflow
713
```yml
8-
name: 'PR TaskList Completed Checker'
14+
name: 'PR Checklist'
915
on:
1016
pull_request:
1117
types: [edited, opened, synchronize, reopened]
1218

1319
jobs:
14-
task-check:
20+
pr-checklist:
1521
runs-on: ubuntu-latest
1622
steps:
17-
- uses: venkatsarvesh/pr-tasks-completed-action@v1.0.0
23+
- uses: wp-media/pr-checklist-action@test/adaptation-to-WPMedia-template
1824
with:
19-
repo-token: "${{ secrets.GITHUB_TOKEN }}"
25+
repo-token: "${{ secrets.PR_CHECKLIST_TOKEN }}"
2026
```
2127
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
3629
37-
All tasks completed:
38-
![All tasks completed](images/success.png)
30+
The PR_CHECKLIST_TOKEN must provide read access to Pull Requests of the repository this action is used in.
3931
40-
Some tasks are still pending:
32+
### Making the check mandatory to merge
4133
42-
![Some tasks are still pending](images/failure.png)
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`
4338

44-
You can check a list of uncompleted tasks at the Actions page on clicking Details.
45-
![List of pending tasks](images/pending_tasks.png)
39+
## Build
4640

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.
4743

4844
## :memo: Licence
49-
MIT
45+
MIT

action.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
name: "PR TaskList Completed Checker"
2-
description: "An action that checks if all the tasks(if any) in the PR body are completed"
1+
name: "WP Media PR Checklist Action"
2+
description: "A GitHub action that performs checks on PR descriptions, according to WP Media PR template"
33
inputs:
44
repo-token:
5-
description: "The GITHUB_TOKEN secret"
5+
description: "The PR_CHECKLIST_TOKEN secret token with read access to Pull Requests."
66
required: true
77
runs:
8-
using: "node12"
8+
using: "node20"
99
main: "dist/index.js"

0 commit comments

Comments
 (0)