File tree Expand file tree Collapse file tree 7 files changed +11
-7
lines changed
Expand file tree Collapse file tree 7 files changed +11
-7
lines changed Original file line number Diff line number Diff line change 1- ** Edit: ** Some additional info
1+ This is still the second line.
Original file line number Diff line number Diff line change 11This is a multi-line test comment read from a file.
2- - With GitHub ** Markdown** :sparkles :
3- - Created by [ create-or-update-comment] [ 1 ]
4-
5- [ 1 ] : https://github.com/peter-evans/create-or-update-comment
2+ This is the second line.
Original file line number Diff line number Diff line change @@ -112,6 +112,7 @@ jobs:
112112 with :
113113 comment-id : ${{ steps.couc2.outputs.comment-id }}
114114 body-file : .github/comment-body-addition.md
115+ append-separator : ' ' # space instead of newline
115116 reactions : eyes, rocket
116117
117118 package :
Original file line number Diff line number Diff line change @@ -18,6 +18,9 @@ inputs:
1818 edit-mode :
1919 description : ' The mode when updating a comment, "replace" or "append".'
2020 default : ' append'
21+ append-separator :
22+ description : ' The separator to use when appending to an existing comment.'
23+ default : ' \n'
2124 reactions :
2225 description : ' A comma or newline separated list of reactions to add to the comment.'
2326outputs :
Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ function createOrUpdateComment(inputs) {
118118 repo: repo,
119119 comment_id: inputs.commentId
120120 });
121- commentBody = comment.body + '\n' ;
121+ commentBody = comment.body + inputs.appendSeparator ;
122122 }
123123 commentBody = commentBody + body;
124124 core.debug(`Comment body: ${commentBody}`);
@@ -220,6 +220,7 @@ function run() {
220220 body: core.getInput('body'),
221221 bodyFile: core.getInput('body-file'),
222222 editMode: core.getInput('edit-mode'),
223+ appendSeparator: core.getInput('append-separator'),
223224 reactions: utils.getInputAsArray('reactions')
224225 };
225226 core.debug(`Inputs: ${(0, util_1.inspect)(inputs)}`);
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ export interface Inputs {
1010 body : string
1111 bodyFile : string
1212 editMode : string
13+ appendSeparator : string
1314 reactions : string [ ]
1415}
1516
@@ -105,7 +106,7 @@ export async function createOrUpdateComment(inputs: Inputs): Promise<void> {
105106 repo : repo ,
106107 comment_id : inputs . commentId
107108 } )
108- commentBody = comment . body + '\n'
109+ commentBody = comment . body + inputs . appendSeparator
109110 }
110111
111112 commentBody = commentBody + body
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ async function run(): Promise<void> {
1414 body : core . getInput ( 'body' ) ,
1515 bodyFile : core . getInput ( 'body-file' ) ,
1616 editMode : core . getInput ( 'edit-mode' ) ,
17+ appendSeparator : core . getInput ( 'append-separator' ) ,
1718 reactions : utils . getInputAsArray ( 'reactions' )
1819 }
1920 core . debug ( `Inputs: ${ inspect ( inputs ) } ` )
You can’t perform that action at this time.
0 commit comments