Coder Social home page Coder Social logo

github-pr-release's Introduction

github-pr-release

Build Status

Create a release pull request by using Github API. Inspired by git-pr-release.

  • No dependency on git. You can easily deploy it to Heroku etc.
  • Fast because it uses only Github API.

Gyazo

Usage

release(config)

Create a release pull request and return Promise.

You must pass a config as an argument.

var release = require('github-pr-release')

var config = {
  token: 'your github token',
  owner: 'uiureo',
  repo:  'awesome-web-app',
  head:  'master',                       // optional
  base:  'production',                   // optional
  template: '/path/to/template.mustache' // optional
}

release(config).then(function (pullRequest) {
  // success
})

pullRequest is an object that github api returns.

See: https://developer.github.com/v3/pulls/#get-a-single-pull-request

Install

npm install github-pr-release

Tips

Pull request titles

If one of pull requests of which consist a release pull request has a title like "Bump to v1.0", the title of the release pull request becomes "Release v1.0". Otherwise, it uses timestamps like "Release 2000-01-01 00:00:00" in local timezone.

Specify a message format

You can specify a template to change the message format. Pass a template path to config.template.

release({
  token: 'token'
  owner: 'uiureo',
  repo:  'awesome-web-app',
  template: './template.mustache'
})

The default template is below. The first line is treated as the title.

Release {{version}}
{{#prs}}
- [ ] #{{number}} {{title}} {{#assignee}}@{{login}}{{/assignee}}{{^assignee}}{{#user}}@{{login}}{{/user}}{{/assignee}}
{{/prs}}

Example

hubot

release = require('github-pr-release')
module.exports = (robot) ->
  robot.respond /release/i, (msg) ->
    release(config).then((pullRequest) ->
      msg.send pullRequest.html_url
    )
    .catch((err) ->
      msg.send("Create release PR failed: " + err.message)
    )

License

MIT

github-pr-release's People

Contributors

hiroshi avatar uiur avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.