DEV Community

Giulia Chiola
Giulia Chiola

Posted on β€’ Edited on β€’ Originally published at giuliachiola.dev

How to set up GitHub/GitLab issue and PR templates

Templates for both GitLab and GitHub

Use the content that works best for you, here there are mine.

Template Snippet
issue πŸ™ GitHub snippet
pull request / merge request πŸ™ GitHub snippet
release πŸ™ GitHub snippet

Basic

GitHub

  • Create .github folder in project root.
  • Add templates files following this folder structure
β”œβ”€β”€ .gitlab/
β”‚   β”œβ”€β”€ ISSUE_TEMPLATE/
β”‚   β”‚   β”œβ”€β”€ issue-templates.md
β”‚   β”œβ”€β”€ PULL_REQUEST_TEMPLATE/
β”‚   β”‚   β”œβ”€β”€ merge-request-templates.md
β”‚   β”œβ”€β”€ RELEASE_TEMPLATE/
β”‚   β”‚   β”œβ”€β”€ release-templates.md
Enter fullscreen mode Exit fullscreen mode
  • Commit and push on our default branch.

  • Check our project on GitHub. From now on, when we will open an issue, it will be pre-compiled with the markdown template we added.

issue template 01

issue template 02

GitLab

In GitLab is pretty much the same, but here we have to create a folder named .gitlab, and add this folders structure:

β”œβ”€β”€ .gitlab/
β”‚   β”œβ”€β”€ issue_templates/
β”‚   β”‚   β”œβ”€β”€ issue-templates.md
β”‚   β”œβ”€β”€ merge_request_templates/
β”‚   β”‚   β”œβ”€β”€ merge-request-templates.md
β”‚   β”œβ”€β”€ release_templates/
β”‚   β”‚   β”œβ”€β”€ release-templates.md
Enter fullscreen mode Exit fullscreen mode

Advanced

If we need different templates to choose, we have to add folders instead of files, and add many files as we need.

β”œβ”€β”€ .github
β”‚   β”œβ”€β”€ ISSUE_TEMPLATE
β”‚   β”‚   β”œβ”€β”€ bug-report.md
β”‚   β”‚   β”œβ”€β”€ feature.md
β”‚   β”‚   β”œβ”€β”€ nice-to-have.md
β”‚   β”œβ”€β”€ PULL_REQUEST_TEMPLATE.md
β”‚   β”œβ”€β”€ RELEASE_TEMPLATE
β”‚   β”‚   β”œβ”€β”€ default.md
β”‚   β”‚   β”œβ”€β”€ hotfix.md
Enter fullscreen mode Exit fullscreen mode

πŸ“š More info

Image of Datadog

Create and maintain end-to-end frontend tests

Learn best practices on creating frontend tests, testing on-premise apps, integrating tests into your CI/CD pipeline, and using Datadog’s testing tunnel.

Download The Guide

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay