Skip to content

GHCLI Created PR's do not use Pull Request Template if the PR is directly submitted without viewing #388

@amoore-incomm

Description

@amoore-incomm

Describe the bug

We use Pull request templates in many of our repos. When creating a Pull request using the GH CLI, if after entering the Title and Body (either pressing E and closing the editor window, or pressing enter to skip entirely) you select Submit to create the PR automatically, the PR template is not used.

However, if on the last step you select Preview in browser, it will use the PR Template to auto populate the body of your pull request.

Steps to reproduce the behavior

  1. Clone a Repository with a PULL_REQUEST_TEMPLATE.md in it
  2. Make some branch, and commit some change
  3. create the PR using the command gh pr create
  4. For Title put in something aka Test Pr
  5. For Body press enter to skip
  6. For What's next, select Submit and view the PR

The PR WILL NOT have a body built using the PULL_REQUEST_TEMPLATE.md file.

Repeating steps 1-5 and instead
6. For What's Next, select Preview in browser

The PR WILL have a body built using the PULL_REQUEST_TEMPLATE.md file

Expected vs actual behavior

Expected: The file PULL_REQUEST_TEMPLATE.md will be used during the creation of any PR's from the GHCLI, unless the body is specifically overloaded during creation

Actual: The file PULL_REQUEST_TEMPLATE.md is not used during the creation of a PR without a specific body overload if the Submit option is used.

Logs

Not applicable, error does not exist in logs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority-3Affects a small number of users or is largely cosmetic

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions