diff --git a/lib/Repository.js b/lib/Repository.js index fb200397..63dc7538 100644 --- a/lib/Repository.js +++ b/lib/Repository.js @@ -231,6 +231,17 @@ class Repository extends Requestable { return this._request('GET', `/repos/${this.__fullname}/commits/${sha}/statuses`, null, cb); } + /** + * Get the combined commit Status for a specific sha, branch or tag + * @see https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref + * @param {string} sha - the sha, branch, or tag to get statuses for + * @param {Requestable.callback} cb - will receive the list of statuses + * @return {Promise} - the promise for the http request + */ + getCombinedStatus(sha, cb) { + return this._request('GET', `/repos/${this.__fullname}/commits/${sha}/status`, null, cb); + } + /** * Get a description of a git tree * @see https://developer.github.com/v3/git/trees/#get-a-tree diff --git a/test/repository.spec.js b/test/repository.spec.js index ef5101cf..eed13de9 100644 --- a/test/repository.spec.js +++ b/test/repository.spec.js @@ -239,6 +239,21 @@ describe('Repository', function() { })); }); + it('should get the combined status for a SHA from a repo', function(done) { + remoteRepo.getCombinedStatus(v10SHA, assertSuccessful(done, function(err, combinedStatus) { + expect(combinedStatus).to.be.an.object(); + expect(combinedStatus).to.have.property('state'); + expect(combinedStatus.state).to.equal('success'); + + expect(combinedStatus).to.have.property('statuses'); + expect(combinedStatus.statuses).to.be.an.array(); + expect(combinedStatus.statuses.length).to.equal(1); + expect(combinedStatus.statuses[0].url).to.equal(statusUrl); + + done(); + })); + }); + it('should get a SHA from a repo', function(done) { remoteRepo.getSha('master', '.gitignore', assertSuccessful(done)); }); pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy