Starter pull request templates we use for internal projects. Feel free to fork and adapt.
Merging changes through pull requests helps us with accountability, documentation, and code reviews. But it's hard to remember everything that goes into a PR, and to remember the steps to take when deploying to staging or production.
See
- GitHub: Creating a pull request template for your repository
- Paige Niedringhaus/Medium: Github Templates: The Smarter Way to Formalize Pull Requests Among Development Teams
We currently use two templates:
- The base PR template will always show up. It includes a link to the deploy template, a place to document what the PR does, a place for extra notes, and some resource links.
- The deploy PR template is accessed through a custom link (see below). It includes a place to note all the previous PRs it includes, as well as a checklist for deploying to production.
Per GitHub, you can put your templates in a hidden .github
directory, or in a docs
directory. You could just download and copy over the .github
directory from this repo.
The base PR template
The deploy repository link automatically:
- creates a pull request to merge your staging branch into your production branch
- Titles it
DEPLOY YYYY-MM-DD
(you still have to replace the date) - Labels it
DEPLOY
Replace the variables in this URL (it's using JS syntax, so get rid of the concatenation symbols too) and then add it to your base PR template.
'https://github.com/' + UserName + '/' + repoName + '/compare/' + prodBranch + '...' + stagingBranch + '?title=DEPLOY+YYYY-MM-DD&labels=DEPLOY&template=deploy.md'
You may also want to change some of the checklist steps, or ask for different information. Go to town!
Commit and merge the files into your default branch, whatever it is. Try making a PR and see what happens!