@@ -30,7 +30,7 @@ Not sure what this means? [Click here to learn what changesets are](https://git
30
30
` ;
31
31
32
32
const getCommentId = ( context , params ) =>
33
- context . github . pullRequests . listComments ( params ) . then ( comments => {
33
+ context . github . issues . listComments ( params ) . then ( comments => {
34
34
const changesetBotComment = comments . data . find (
35
35
// TODO: find what the current user is in some way or something
36
36
comment =>
@@ -67,8 +67,9 @@ module.exports = app => {
67
67
try {
68
68
const params = context . issue ( ) ;
69
69
70
- let queryStuff = {
71
- pull_number : context . payload . number ,
70
+ let number = context . payload . number ;
71
+
72
+ let repo = {
72
73
repo : context . payload . repository . name ,
73
74
owner : context . payload . repository . owner . login
74
75
} ;
@@ -90,23 +91,19 @@ module.exports = app => {
90
91
// but reducing time is nice here so that
91
92
// deploying this doesn't cost money
92
93
context . payload . action === "synchronize"
93
- ? getCommentId ( context , queryStuff )
94
+ ? getCommentId ( context , { ... repo , issue_number : number } )
94
95
: null ,
95
- getChangesetId ( context , queryStuff )
96
+ getChangesetId ( context , { ... repo , pull_number : number } )
96
97
] ) ;
97
98
98
- let prComment ;
99
- if ( ! hasChangeset ) {
100
- prComment = context . issue ( {
101
- comment_id : commentId ,
102
- body : getAbsentMessage ( latestCommitSha , addChangesetUrl )
103
- } ) ;
104
- } else {
105
- prComment = context . issue ( {
106
- comment_id : commentId ,
107
- body : getApproveMessage ( latestCommitSha , addChangesetUrl )
108
- } ) ;
109
- }
99
+ let prComment = {
100
+ ...repo ,
101
+ comment_id : commentId ,
102
+ issue_number : number ,
103
+ body : hasChangeset
104
+ ? getApproveMessage ( latestCommitSha , addChangesetUrl )
105
+ : getAbsentMessage ( latestCommitSha , addChangesetUrl )
106
+ } ;
110
107
111
108
if ( commentId ) {
112
109
return context . github . issues . updateComment ( prComment ) ;
0 commit comments