Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Add support for GitHub's new Deployment API #18

Closed
stephenyeargin opened this issue Jan 18, 2014 · 1 comment
Closed

Feature: Add support for GitHub's new Deployment API #18

stephenyeargin opened this issue Jan 18, 2014 · 1 comment

Comments

@stephenyeargin
Copy link
Contributor

Reference: http://developer.github.com/changes/2014-01-09-preview-the-new-deployments-api/
Reference: http://developer.github.com/v3/repos/deployments/#preview-mode

During the preview period, a special header has to be sent along.

req = http.create(url).header("Accept", "application/vnd.github.cannonball-preview+json")

There are two verbs in the API to care about, provided this doesn't change dramatically prior to release.


GET /repos/:owner/:repo/deployments

Gets the list of created deployments and their statuses.

POST /repos/:owner/:repo/deployments

Creates a deployment with an applicable payload of data (target, description, etc.)


The other parts of the API are intended for use with the third-party deployment tool, such as updating the status of a deployment as it goes through its process. That may be beyond the needful scope any hubot/etc. integration.

@iangreenleaf
Copy link
Owner

First off, it should be possible to use these features immediately through the generic request capability (plus the apiVersion option):

module.exports = (robot) ->
  github = require('githubot')(robot, apiVersion: 'cannonball-preview')
    github.get "https://api.github.com/repos/iangreenleaf/githubot/deployments", -> #...

It would be even cooler to have bespoke access to these features (following the example of the branches api). With that interface, githubot could be helpful and override the api version header for only those requests, saving people the trouble of doing it manually. If you're interested in seeing this happen, I'd encourage you to try a pull request! There should be some example code to use as a starting point, and I'm happy to answer any questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants