File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -114,7 +114,7 @@ export default class VotingSession extends Session {
114
114
const body = 'I would like to close this vote, and for this effect, I\'m revealing my ' +
115
115
`key part:\n\n${ '```' } \n${ keyPart } \n${ '```' } \n` ;
116
116
if ( this . postComment ) {
117
- const { html_url } = await this . req . json ( `https://api.github.com/repos/${ this . owner } /${ this . repo } /issues/${ this . prid } /comments` , {
117
+ const { message , html_url } = await this . req . json ( `https://api.github.com/repos/${ this . owner } /${ this . repo } /issues/${ this . prid } /comments` , {
118
118
agent : this . req . proxyAgent ,
119
119
method : 'POST' ,
120
120
headers : {
@@ -124,13 +124,23 @@ export default class VotingSession extends Session {
124
124
} ,
125
125
body : JSON . stringify ( { body } )
126
126
} ) ;
127
- this . cli . log ( 'Comment posted at:' , html_url ) ;
128
- } else if ( isGhAvailable ( ) ) {
127
+ if ( html_url ) {
128
+ this . cli . log ( `Comment posted at: ${ html_url } ` ) ;
129
+ return ;
130
+ } else {
131
+ this . cli . error ( 'Failed to post comment' ) ;
132
+ this . cli . info ( message ) ;
133
+ }
134
+ }
135
+ if ( isGhAvailable ( ) ) {
129
136
this . cli . log ( '\nRun the following command to post the comment:\n' ) ;
130
137
this . cli . log (
131
138
`gh pr comment ${ this . prid } --repo ${ this . owner } /${ this . repo } ` +
132
139
`--body-file - <<'EOF'\n${ body } \nEOF`
133
140
) ;
141
+ } else {
142
+ this . cli . log ( '\nPost the following comment on the PR thread:\n' ) ;
143
+ this . cli . log ( body ) ;
134
144
}
135
145
}
136
146
}
You can’t perform that action at this time.
0 commit comments