DEV Community

Cover image for How to Create a Good Pull Request Template (and Why You Should Add Gifs)
BekahHW for OpenSauced

Posted on • Edited on

How to Create a Good Pull Request Template (and Why You Should Add Gifs)

I wasn’t in tech when Pull Requests (PRs) were first introduced by GitHub back in 2008. And when I graduated from bootcamp four years ago, I had probably created only a handful of PRs. I quickly learned how vital PRs were when I started my first job on a team though. And my appreciation for a good Pull Request has only increased as I spend more time as a maintainer.

The great things about Pull Requests are that they allow for collaboration between contributors and maintainers, offer an opportunity to communicate changes that have been made and why they are important, and the ability for maintainers to provide feedback. Because contributors come from different backgrounds, have varying degrees of experience, and speak different languages, sometimes creating good PRs can be tricky. But there are some ways to optimize the experience for everyone–including adding gifs.

How to Create a Pull Request Template

Maintainers can help to improve the experience for both reviewing Pull Requests and for contributors submitting them by creating a template.

I like to think of Pull Request templates as a kind of contributor onboarding. It helps to guide them through the process of writing a good pull request and communicating with the maintainers. Although good templates may vary according to different organizations, their standards, and their needs, there are some basic checklists that you can use to generate your own.

To create a PR template in GitHub, create a .github folder in the root of your repository and a file called PULL_REQUEST_TEMPLATE.md.

At OpenSauced, we used forem’s Pull Request template for inspiration for
our template.

gif of OpenSauced’s PR template

You can use markdown to create your template, and include sections like:

  • What type of PR is this?
  • Description of the changes
  • Related Tickets & Documents
  • Mobile & Desktop Screenshots/Recordings
  • Tests
  • Documentation
  • Post-deployment tasks
  • What gif best describes this PR or how it makes you feel?

Let Them Add Gifs!

That last one might seem out of place to you, but it can actually make the PR experience more fun, engaging, and effective. Here's why:

  • Gifs can bridge language gaps and help contributors express themselves more clearly.
  • Gifs can showcase contributors' personalities and add a personal touch to the PR.
  • Gifs can increase engagement and make the review process more enjoyable for everyone.

How to add Gifs to Your PR

If you’re a contributor, you might be wondering, “What’s the easiest way to add a gif?” I use the GIFs for GitHub chrome extension. Once it’s installed, you’ve got a quick way to add all your favorite gifs to enhance that PR experience. Just search for the gif you want, and click it. You can even add a caption to describe the gif or explain how it relates to the PR 👏

adding a gif of leslie knope and april with the caption “How much fun is it working here!?

You can read more about PRs with @Brian Douglas’ post on Tips for getting your Pull Request reviewed on GitHub. Or check out the hottest repos and how they handle PRs on OpenSauced hot repositories. And if you have tips for creating great pull requests, let us know in the comments below.

header image created using midjourney.

Latest comments (34)

Collapse
 
t3st3ro profile image
Tooster

I am strongly biased against specifying the PR type using checkboxes. That's what labels are for, and they also facilitate better searching and machine-readability using tools such as gh. A lot less overhead than grepping the contents.

Collapse
 
xanderrubio profile image
Alexander Clemens

Thanks @bekahhw for sharing and adding this to my open source project no to come back to in the furute to enhance or pull request template.

Collapse
 
bestwebdevelopment profile image
ReactJS Development Company • Edited

Great post, very informative and helpful for me as a Web developer beginner.

Collapse
 
bekahhw profile image
BekahHW OpenSauced

Thanks for reading!

Collapse
 
fixerrs profile image
Fix Erorrs

Love it!

Collapse
 
bhupesh profile image
Bhupesh Varshney 👾

From the maintainer side, if anyone wants to spice up PRs

GitHub logo Bhupesh-V / memer-action

A GitHub Action for Programmer Memes xD

Memer Action

memer-action-logo

Github marketplace GitHub release (latest by date) Lint Integration Test Twitter: Bhupesh Varshney

Demo

demomemer

Usage

Example workflow

  • You can use the following workflow as it is, just copy/paste in a file named greetings.yml inside your workflows folder.
  • The reply action is performed by create-or-update-comment
name: Memer Workflow

on: [pull_request]

jobs:
  greeting:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@master
      - name: Run Memer Action
        id: memer

        uses: Bhupesh-V/memer-action@master
        with:
          filter: "new"

      - name: Check Outputs
        run: |
          echo "${{ steps.memer.outputs.meme }}"
          echo "${{ steps.memer.outputs.title }}"
          echo "${{ steps.memer.outputs.source }}"

      - name: Create comment
        uses: peter-evans/create-or-update-comment@v1.3.0
        id: couc
        with:
          issue-number: ${{ github.event.number }}
          body: |
            🎉🎉 Thanks for opening this PR/Issue 🤗
            Please wait while the maintainer(s) review it

            Meanwhile have a look at this 😝 :

            > **${{ steps.memer.outputs.title }}**
            ![meme](${{ steps.memer.outputs.meme }})
            <sub>ℹ️ <a href="${{ steps.memer.outputs.source }}">Source</a> [ Powered By 🔥 <a href="https://github.com/Bhupesh-V/memer-action">Memer Action</a> ]</sub>

Inputs

Memer Action accepts following input variables.

  • filter (optional) : Sort Memes posts from reddit…
Collapse
 
teddyboirin profile image
Teddy

Good idea but for the first part of the description, Github tags are more practical

Collapse
 
shirleykohler6730 profile image
Shirley Kohler

Great post, thx!

Collapse
 
jwilliams profile image
Jessica williams

nicely described thanks for sharing this post with us.

Some comments may only be visible to logged-in visitors. Sign in to view all comments.