DEV Community

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

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

BekahHW on April 14, 2023

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 pr...
Collapse
 
cicirello profile image
Vincent A. Cicirello

Nice post. Might be worth mentioning where you explain how to create a template that if you put it in a repository named .github that it applies to all of the repositories that you own, and you only need to maintain it there.

Anyway, nice template. I've been considering making changes to mine and yours gave me some ideas.

Collapse
 
prakhartiwari0 profile image
Prakhar Tiwari

Wow I didn't know that! Thanks

Collapse
 
bekahhw profile image
BekahHW

I thought of adding that, but then decided I could do a whole post on that.

Collapse
 
codergirl1991 profile image
Jessica Wilkins

I love this PR template.

I definitely want to use this for my open source projects and want to suggest it for the teams I am on

Thank you for sharing.

Collapse
 
bekahhw profile image
BekahHW

Thanks, Jessica! Not gonna lie, OpenSauced's PR template is my favorite. I looked at a lot of other ones, but this my favorite.

Collapse
 
0vortex profile image
TED Vortex (Teodor Eugen Duțulescu)

have a dream of upgrading those templates from checkboxes to selects but never get to it in real life :<

Collapse
 
bekahhw profile image
BekahHW

Why do you think selects will be better?

Collapse
 
0vortex profile image
TED Vortex (Teodor Eugen Duțulescu)

Humans are biased to the scanning effect of the first page of content, that is currently taken up by the options of the "type of pull request" selector being spread as checkbox options; this makes it difficult for them to scan the other important sections of the pull request template (description, related tickets, docs, etc)

Thread Thread
 
sinewalker profile image
Mike Lockhart • Edited

I use labels instead, for better scanning, and also selecting PRs for review by type using the labels.

This does need pointing out to contributors, though. You can add HTML comments to PR templates for instructions or guidance.

Collapse
 
jesserweigel profile image
Jesse R Weigel

That is an awesome cover photo! You could be an AI art prompt engineer!

Collapse
 
bekahhw profile image
BekahHW

Hahahah. Thanks for generating it for me.

Collapse
 
jesserweigel profile image
Jesse R Weigel

You're welcome! Anytime!

Collapse
 
sergeyleschev profile image
Sergey Leschev

Adding gifs to the template can also bring more engagement and make the review process more enjoyable. It's good to see that OpenSauced is using forem's template for inspiration.

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

Thanks for reading!

Collapse
 
umeya_kassim profile image
umeya kassim

Nice content il consider adding it in my next personal project new repository.

Collapse
 
bekahhw profile image
BekahHW

Awesome!

Collapse
 
developerdoran profile image
Jake Doran

Great article! One of the things I miss the most about GitHub (my team use BitBucket currently) is the ability to create PR templates they are super handy!

Collapse
 
bekahhw profile image
BekahHW

Yes! I love issue templates too.

Collapse
 
oakamel profile image
Omar Kamel

Gifs is a great idea 💡 that i would like to suggest to my team, thanks 🙏

Collapse
 
satriopamungkas profile image
Muhammad Raihan Satrio Putra Pamungkas

Great explanation. However, I often struggle with providing an appropriate title message when submitting a pull request. I have noticed that many open source repositories have unstructured or messy title messages, which can make it difficult to maintain the repository.

Some people use problems or features as the title, while others add tags for additional information. I believe that it is important to consider the impact of clear and concise title message, as it can save a lot of time when searching.

Collapse
 
bekahhw profile image
BekahHW

I’m writing a blog post about submitting your first PR. I’ll try to make sure I cover titles.

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
 
clericcoder profile image
Abdulsalaam Noibi

Thanks for sharing🤗

Collapse
 
jwilliams profile image
Jessica williams

nicely described thanks for sharing this post with us.

Collapse
 
shirleykohler6730 profile image
Shirley Kohler

Great post, thx!

Collapse
 
thiruxd profile image
ThiruXD ♡︎

I Newly Learn About Github
thanks for this post

Collapse
 
itsmicaio profile image
Caio Fuzatto

Nice post. I was looking for PR templates and that post give me good ideas.

Collapse
 
fixerrs profile image
Fix Erorrs

Love it!