Skip to content

Commit 387d5f2

Browse files
committed
Enable custom comment
1 parent 9ffde46 commit 387d5f2

File tree

6 files changed

+16
-11
lines changed

6 files changed

+16
-11
lines changed

.github/workflows/main.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ jobs:
99
uses: actions/checkout@v1
1010

1111
- name: Comment PR
12-
uses: sbimochan/jira-link-commenter@v2.3
12+
uses: sbimochan/jira-link-commenter@v2.4
1313

1414
with:
1515
jira-project-url: https://jira.atlassian.net/browse
16-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17+
custom-comment: 'Thank you for your contribution!!! :confetti_ball:'

README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ Jira Link: https://jira.atlassian.net/browse/JPT-1571
1919
## Example usage
2020

2121
```yaml
22-
uses: actions/jira-link-commenter@v2.3
22+
uses: actions/jira-link-commenter@v2.4
2323
with:
2424
jira-project-url: 'https://jira.atlassian.net/browse'
25+
custom-comment: 'Thank you for your contribution! :confetti_ball:'
2526
```
2627
2728
### Full example
@@ -38,11 +39,12 @@ jobs:
3839
uses: actions/checkout@v1
3940

4041
- name: Comment PR
41-
uses: sbimochan/jira-link-commenter@v2.3
42+
uses: sbimochan/jira-link-commenter@v2.4
4243

4344
with:
4445
jira-project-url: https://jira.atlassian.net/browse
4546
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
custom-comment: 'Thank you for your contribution! :confetti_ball:'
4648
```
4749
4850
### Recommendations:

action.yml

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ inputs:
77
GITHUB_TOKEN:
88
description: 'Add token'
99
required: true
10+
custom-comment:
11+
description: 'Add custom comment'
12+
default: 'Thank you for your contribution! :confetti_ball:'
13+
required: false
1014
runs:
1115
using: 'node16'
1216
main: 'dist/index.js'

dist/index.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -8449,6 +8449,7 @@ async function runMain() {
84498449
try {
84508450
const jirProjectUrl = core.getInput('jira-project-url');
84518451
const githubToken = core.getInput('GITHUB_TOKEN');
8452+
const customComment = core.getInput('custom-comment');
84528453

84538454
const context = github.context;
84548455
if (context.payload.pull_request == null) {
@@ -8474,9 +8475,7 @@ async function runMain() {
84748475
await octokit.rest.issues.createComment({
84758476
...context.repo,
84768477
issue_number: pullRequestNumber,
8477-
body: `Thank you for your contribution! :confetti_ball: \n Jira link: ${
8478-
jirProjectUrl + '/' + ticketNumber
8479-
}`
8478+
body: `${customComment} \n Jira link: ${jirProjectUrl + '/' + ticketNumber}`
84808479
});
84818480
} catch (error) {
84828481
core.setFailed(error.message);

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jira-link-commenter",
3-
"version": "2.3",
3+
"version": "2.4",
44
"description": "This action auto comments in pull request with Jira link to it.",
55
"main": "src/main.js",
66
"scripts": {

src/main.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ async function runMain() {
55
try {
66
const jirProjectUrl = core.getInput('jira-project-url');
77
const githubToken = core.getInput('GITHUB_TOKEN');
8+
const customComment = core.getInput('custom-comment');
89

910
const context = github.context;
1011
if (context.payload.pull_request == null) {
@@ -30,9 +31,7 @@ async function runMain() {
3031
await octokit.rest.issues.createComment({
3132
...context.repo,
3233
issue_number: pullRequestNumber,
33-
body: `Thank you for your contribution! :confetti_ball: \n Jira link: ${
34-
jirProjectUrl + '/' + ticketNumber
35-
}`
34+
body: `${customComment} \n Jira link: ${jirProjectUrl + '/' + ticketNumber}`
3635
});
3736
} catch (error) {
3837
core.setFailed(error.message);

0 commit comments

Comments
 (0)