Skip to content

(feature): Added support for customization of the PR comment#547

Merged
rdhar merged 8 commits into
OP5dev:mainfrom
FnhNielsen:feat/customize-pr-comment-body
May 1, 2026
Merged

(feature): Added support for customization of the PR comment#547
rdhar merged 8 commits into
OP5dev:mainfrom
FnhNielsen:feat/customize-pr-comment-body

Conversation

@FnhNielsen

@FnhNielsen FnhNielsen commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

This PR introduces a new feature which allows users to customise the the body of the comment left by the action. This feature was requested in #546 and we ended up implementing it ourself and wanted to contribute it.

Fixes #546

Before our contribution

We also validated that this is exactly what it looks like if comment-prefix isn't set.

Screenshot 2026-04-01 at 11 13 24

After our contribution

Here shown with comment-prefix: "# Plan for module <redacted> on `dev`"

Screenshot 2026-04-01 at 14 05 55

@FnhNielsen
FnhNielsen requested a review from rdhar as a code owner April 1, 2026 12:15
@ArkShocer

Copy link
Copy Markdown
Contributor

I tested your branch with my matrix test job, and I don't see any issues other than it not being a prefix. To me, this would more fall under the category of a title/header.
image

@birjj

birjj commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

@ArkShocer Isn't that because you've used a header (# ...) as the prefix? It's the same thing we've done, but I could see others wanting to use something else - entire paragraphs, for example.

@FnhNielsen

Copy link
Copy Markdown
Contributor Author

Bump for visibility

@rdhar rdhar self-assigned this Apr 22, 2026
@rdhar rdhar added the enhancement New feature or request label Apr 22, 2026
@rdhar

rdhar commented Apr 27, 2026

Copy link
Copy Markdown
Member

@FnhNielsen Thank you for raising this PR -- I will be following up on this feature in the upcoming release!

I'm curious if you noticed the presence of invisible comments like <!-- placeholder-1 -->? Perhaps it might be an idea to support passing markdown into any/all of these placeholders, while trying to find a balance between flexibility and (excessive) customizability.

@rdhar rdhar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@FnhNielsen Thanks to building on top of your foundation, I've extended it from a singular prefix/title to a number of positional inputs. This gives the user more flexibility to choose exactly where to interpolate their markdown content. For example, you could pass:

  • comment-pos-1: "### ${{ matrix.environment }}" for a dynamic header title based on the environment; or
  • comment-pos-2: ${{ steps.tflint-comment.outputs.result }} to insert markdown-formatted output from a prior step of the workflow (see TFLint example).

@rdhar
rdhar merged commit 06a3896 into OP5dev:main May 1, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support customization of the comment

4 participants