Configuration
The content of the comment to add to the PR
Whether to create a new comment (true) or update an existing one (false)
Basic Usage
Examples
Simple Comment
Add a basic comment when validations fail:Detailed Feedback with Template Variables
Provide detailed feedback using template variables:Updating Existing Comments
Update the bot’s previous comment instead of creating a new one:Conditional Success Messages
Provide positive feedback when validations pass:Template Variables
The Comment Action supports these template variables:Variable | Description |
---|---|
{{ pull_request.user.login }} | PR author’s username |
{{ pull_request.title }} | PR title |
{{ pull_request.body }} | PR description |
{{ pull_request.number }} | PR number |
{{ repository.name }} | Repository name |
{{ repository.full_name }} | Full repository name (owner/repo) |
{{ validation_summary }} | Summary of all validation results |
How It Works
1
Process Template
The action processes the comment body, replacing template variables with actual values
2
Check Settings
If
create_new
is false, it looks for a previous comment from the Rulesets bot3
Update or Create
If an existing bot comment is found (and
create_new
is false), it updates that comment; otherwise, it creates a new commentPractical Use Cases
Onboarding New Contributors
Provide guidance to first-time contributors:CI Failure Summary
Summarize CI failures to save time:Labeling Explanation
Explain why certain labels were added:Best Practices
Use Markdown formatting to make comments readable and structured
Include actionable feedback that helps contributors fix issues
Use template variables to personalize comments
Set
create_new: false
to avoid cluttering PRs with multiple similar commentsAvoid making comments too verbose or adding them too frequently, as this can be perceived as noisy
Limitations
- Comments are always posted from the GitHub App’s account
- Markdown formatting in comments is limited to what GitHub supports
- Template variables are limited to those provided by Rulesets