Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to automatically add a checklist to new github PR's?

Tags:

github

When a Github pull request is created, it would be very nice to have a (code review) checklist added automatically to the PR. This could then be filled out by the PR submitter, and the reviewers would be able to see that the submitter has done what he is supposed to do before sending for review.

Is that possible somehow?

The best solution would be that the checklist showed up automatically when the PR was created. The second best could be an automatic comment added right after the PR was made.

like image 744
bmunk Avatar asked Aug 12 '14 19:08

bmunk


People also ask

How do I create a checklist in GitHub?

To create a task list, preface list items with a hyphen and space followed by [ ] . To mark a task as complete, use [x] . Tip: You cannot create task list items within closed issues or issues with linked pull requests.

How do I automatically add reviews to GitHub?

At the top of the team page, click Settings. In the left sidebar, click Code review. Select Enable auto assignment. Under "How many team members should be assigned to review?", use the drop-down menu and choose a number of reviewers to be assigned to each pull request.

How do I make a code review mandatory on GitHub?

How it works. To require multiple reviewers for pull requests, go to your repository's settings and select “Branches”. Under “Protected branches”, select the branch you'd like to protect with a multiple reviewers requirement. There you can select the number of reviewers required for each pull request to that branch.


1 Answers

You can add a PULL_REQUEST_TEMPLATE.md file to the root of your repo and it will be used as the template for new pull requests. You can use Github-flavored markup in that file.

So, in your template file, just add whatever markup you want. For a checklist:

Doneness:
- [ ] Testing
- [ ] Documentation

There's also an ISSUE_TEMPLATE.md file that does the same thing, but for new issues.

Official post: https://github.com/blog/2111-issue-and-pull-request-templates

like image 99
James van Dyke Avatar answered Oct 10 '22 08:10

James van Dyke