> ## Documentation Index
> Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Demo Developer Workflow Standards PR Template

> Guide to add a GitHub pull request template to a Node.js repo, providing consistent PR descriptions, testing instructions, and a reviewer checklist.

This guide shows how to add a GitHub pull request (PR) template to the `ghs-guardrails-demo` repository. A PR template helps contributors provide consistent context, testing information, and a checklist when opening pull requests for the small Node.js application in this repo.

Why add a PR template?

* Ensures reviewers get consistent information.
* Speeds up reviews by highlighting tests, breaking changes, and required checklist items.
* Encourages contributors to follow project standards.

## Prerequisites

* Push access to the repository (or create a branch and open a PR).
* Basic Git knowledge (creating branches, committing, pushing).

## Steps

1. Create the template file\
   Create a file at `.github/pull_request_template.md` in the repository root. GitHub recognizes files in the `.github` folder as repository-level templates.

2. Add the PR template contents\
   Paste the following content into `.github/pull_request_template.md`. This example covers description, change type, testing, and a checklist that your maintainers can adapt to the project's workflow.

```markdown theme={null}
## Description
<!-- Summary of changes, problem solved, and motivation -->
Fixes #<issue-number>

## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Chore / Refactoring
- [ ] Documentation update

## How Has This Been Tested?
<!-- Describe tests, environment, or steps to reproduce -->

## Checklist
- [ ] My code follows project style guidelines.
- [ ] I have self-reviewed my code.
- [ ] I have updated documentation.
- [ ] I have added tests that prove my fix is effective.
```

3. Commit the change\
   You can commit directly via the GitHub web UI (if allowed) or use the command line. Example workflow using a branch:

```bash theme={null}
git checkout -b add/pr-template
git add .github/pull_request_template.md
git commit -m "chore: add pull request template"
git push origin add/pr-template
```

4. Open a pull request (if you pushed a branch) or confirm the template is applied (if you committed to `main`)\
   When a contributor opens a new PR, GitHub will pre-populate the PR description with the template contents. Note that the template does not create a PR automatically; it only populates the PR description when one is opened.

Tip: Keep the template concise and specific to your repository's review requirements. Consider adding links to CI status pages or contributing guidelines to make it easier for contributors to follow the process.

## Template sections explained

| Template Section | Purpose | Example / Notes |
| - | - | - |
| Description | Summarize what the PR changes and why | Use `Fixes #<issue-number>` to auto-close issues when the PR is merged |
| Type of Change | Clarify the nature and impact of the change | Choose one: bug fix, feature, breaking change, etc. |
| How Has This Been Tested? | Explain how reviewers can validate the change | Include environment, manual steps, or CI test references |
| Checklist | Ensure code quality and process steps are followed | Typical checks: style, self-review, docs, added tests |

## Verifying the template

* Open a new PR in the repository to confirm that the template content appears in the PR description.
* Update the template over time as review requirements change (e.g., add automated checklist items linked to CI jobs or test results).

Notes on behavior and usage

* The PR template file serves as the default content for new PR descriptions; it does not open PRs automatically.
* If you have multiple templates, consider using GitHub’s issue and PR template chooser (see links below).

If branch protection rules are in place, you may not be able to commit directly to `main`. Some environments have bypass rules that allow privileged users to bypass protection; use such bypasses sparingly and only when appropriate.

## Links and references

* GitHub: Pull request template docs — [https://docs.github.com/en/github/building-a-strong-community/creating-a-pull-request-template](https://docs.github.com/en/github/building-a-strong-community/creating-a-pull-request-template)
* GitHub: About issue and pull request templates — [https://docs.github.com/en/github/building-a-strong-community/about-issue-and-pull-request-templates](https://docs.github.com/en/github/building-a-strong-community/about-issue-and-pull-request-templates)

You can test the template in a follow-up article by opening a new PR and confirming the template is applied.

> [card] [Watch Video](https://learn.kodekloud.com/user/courses/github-administration-certification/module/e4b7bd78-3fb5-4c1c-94d8-e528b0b60484/lesson/777f61cb-ddf0-4619-b258-4ea63a2580e5)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.