2

I need to write some comments in a GitHub PR template that will only be visible to the person who is creating (or editing) the PR, but will not be not visible on the pull request description once it's created/edited.

Is there a way to do that?

1
  • I'm not sure if you can do that. But a solution would be to create a GitHub Action that triggers when a pull request is created and then adds a private comment to the pull request to the user who created it. Hope it helps. Mar 22 at 1:30

2 Answers 2

1
+50

This is possible using HTML comments - see below. The comment will only be visible when creating or editing the PR description.

# My PRE template

My template

<!-- My private comment -->

The rest of the template

Another option would be to use a GitHub Action to scan the PR description and remove some of it via pattern matching. This GitHub Action is an example of that pattern: https://github.com/luigibertaco/dynamic-template-action

The advantage of HTML comments is that they will continue to be visible later when re-editing the PR description.

0

One option would be to create a test that checks the template text doesn't exists on any files.
This would be paired with a practice of PR reviews being started after all tests are passing

1
  • The question is about comments in the PR template itself
    – Roy Tinker
    Mar 22 at 17:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.