Skip to content

Commit ac6d62c

Browse files
committed
Added getPullComments and setStatus
1 parent ffd7226 commit ac6d62c

1 file changed

Lines changed: 26 additions & 1 deletion

File tree

github.js

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,15 @@
315315
});
316316
};
317317

318+
// Get PR comments
319+
this.getPullComments = function(id, cb) {
320+
_request("GET", repoPath + "/issues/" + id + "/comments", null, function(err, comments) {
321+
if (err) return cb(err);
322+
cb(null, comments);
323+
});
324+
}
325+
326+
318327
// Retrieve the changes made between base and head
319328
// -------
320329

@@ -659,8 +668,24 @@
659668
}
660669
_request("GET", url, null, cb);
661670
};
662-
};
663671

672+
673+
// Set Commit Status
674+
// -------
675+
//
676+
// {
677+
// state: 'pending'|'success'|'failure'|'error' (required),
678+
// target_url: 'http://ci.example.com/user/repo/build/sha',
679+
// description: 'text of status, shown to user',
680+
// context: 'continuous-integration/my-service'
681+
// }
682+
683+
this.setStatus = function(sha, options, cb) {
684+
_request("POST", repoPath + "/statuses/" + sha, options, cb);
685+
};
686+
};
687+
688+
664689
// Gists API
665690
// =======
666691

0 commit comments

Comments
 (0)