You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/workflows/pr-auto-comments.yml
+42-6Lines changed: 42 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -16,17 +16,17 @@ on:
16
16
description: 'Message for first PR comments (leave empty to disable first PR comments)'
17
17
required: false
18
18
type: string
19
-
default: ''
19
+
default: 'Hello @{{username}}, thank you for submitting your first pull request to the {{repository}} repository. We value your contribution and encourage you to review our contribution guidelines to ensure your submission meets our standards. Please note that every merged PR is automatically enrolled in our Best PR Initiative, offering a chance to win $500 each quarter. Our team is available via GitHub Discussions or Discord if you have any questions. Welcome aboard!'
20
20
ready_for_review_comment:
21
21
description: 'Message for PR ready for review comments (leave empty to disable ready for review comments)'
22
22
required: false
23
23
type: string
24
-
default: ''
24
+
default: 'Thank you for your submission! As you prepare for the review process, please ensure that your PR title, description, and any linked issues fully comply with our contribution guidelines. A clear explanation of your changes and their context will help expedite the review process. Every merged PR is automatically entered into our Best PR Initiative, offering a chance to win $500 every quarter. We appreciate your attention to detail and look forward to reviewing your contribution!'
25
25
merged_pr_comment:
26
26
description: 'Message for merged PR comments (leave empty to disable merged PR comments)'
27
27
required: false
28
28
type: string
29
-
default: ''
29
+
default: 'Congratulations, your pull request has been merged! Thank you for your valuable contribution to Request Network. As a reminder, every merged PR is automatically entered into our Best PR Initiative, offering a quarterly prize of $500. Your work significantly supports our project\'s growth, and we encourage you to continue engaging with our community. Additionally, if you want to build or add crypto payments and invoicing features, explore how our API can reduce deployment time from months to hours while offering advanced features. Book a call with our expert to learn more and fast-track your development.'
30
30
secrets:
31
31
token:
32
32
description: 'GitHub token with org:read permission'
| `first_pr_comment` | Message for first PR comments | Default welcome message | First PR comments disabled |
54
+
| `ready_for_review_comment` | Message for ready for review comments | Default guidelines message | Ready for review comments disabled |
55
+
| `merged_pr_comment` | Message for merged PR comments | Default thank you message | Merged PR comments disabled |
61
56
62
57
### Secrets
63
58
64
59
| Secret | Description | Required | Default |
65
60
|--------|-------------|----------|---------|
66
61
| `token` | GitHub token with org:read permission | No | `github.token` |
67
62
63
+
## Default Messages
64
+
65
+
The workflow includes default messages for each comment type:
66
+
67
+
### First PR Comment
68
+
A welcome message that mentions the contributor by username, introduces them to the project, and highlights the Best PR Initiative with its $500 quarterly prize.
69
+
70
+
### Ready for Review Comment
71
+
A reminder about contribution guidelines and the Best PR Initiative, encouraging clear PR descriptions to expedite the review process.
72
+
73
+
### Merged PR Comment
74
+
A congratulatory message that thanks the contributor, reminds them about the Best PR Initiative, and promotes the Request Network API for crypto payments and invoicing features.
75
+
68
76
## Enabling and Disabling Comment Types
69
77
70
-
You can selectively enable comment types by providing content for the corresponding input:
78
+
By default, all comment types are enabled with predefined messages. You can:
79
+
80
+
- **Override** a default comment by providing your own message text
81
+
- **Disable** a comment type by providing an empty string `''`
82
+
83
+
For example, to disable ready for review comments:
71
84
72
-
- To **enable** a comment type: provide the message text
73
-
- To **disable** a comment type: omit the input or provide an empty string
85
+
```yaml
86
+
ready_for_review_comment: '' # Explicitly set to empty string to disable
87
+
```
88
+
89
+
## Dynamic Content with Variable Placeholders
90
+
91
+
You can include dynamic content in your messages using placeholders with the format `{{variable}}`. The following variables are available:
74
92
75
-
For example, to enable only first PR and merged PR comments:
93
+
| Variable | Description | Example |
94
+
|----------|-------------|---------|
95
+
| `{{username}}` | The PR author's username | `octocat` |
96
+
| `{{repository}}` | The repository name | `auto-comments` |
97
+
| `{{org}}` | The organization/owner name | `your-org` |
98
+
99
+
Example usage in a custom message:
76
100
77
101
```yaml
78
102
first_pr_comment: |
79
-
# Welcome!
80
-
Thanks for your contribution.
81
-
# ready_for_review_comment is omitted to disable it
82
-
merged_pr_comment: |
83
-
# Merged
84
-
Your PR has been merged.
103
+
# Welcome @{{username}}!
104
+
105
+
Thank you for your first contribution to the {{repository}} repository.
106
+
We at {{org}} appreciate your interest in our project.
85
107
```
86
108
87
109
## Comment Formatting
@@ -95,6 +117,10 @@ You can use full Markdown syntax in your comment messages, including:
95
117
- Code blocks
96
118
- Emojis (`:tada:`)
97
119
120
+
## Special Placeholders
121
+
122
+
The first PR comment supports the `@<username>` placeholder, which will be automatically replaced with the PR author's username.
123
+
98
124
## How It Works
99
125
100
126
1. The workflow first checks the PR author in a central job:
@@ -103,7 +129,7 @@ You can use full Markdown syntax in your comment messages, including:
103
129
104
130
2. Based on the event type (opened/ready for review/merged) and author status:
105
131
- Runs only the appropriate comment job
106
-
- Only if the corresponding comment text is provided
132
+
- Only if the corresponding comment text is not empty
107
133
108
134
3. Each enabled job posts its specific comment to the PR
0 commit comments