Created
January 19, 2015 14:54
-
-
Save ryonext/2906f7bd9c865c2d8f1b to your computer and use it in GitHub Desktop.
Hubotでpull reqつくるやつ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Description: | |
# Create pull request from develop to master. | |
# | |
# Dependencies: | |
# "githubot": "0.4.x" | |
# | |
# Configuration: | |
# HUBOT_GITHUB_TOKEN | |
# HUBOT_GITHUB_USER | |
# HUBOT_GITHUB_ORG | |
# | |
# Commands: | |
# hubot deploy <repo> | |
# | |
# Author: | |
# ryonext | |
module.exports = (robot) -> | |
github = require("githubot")(robot) | |
robot.respond /deploy ?(.+)/i, (msg) -> | |
repo = msg.match[1] | |
url_api_base = "https://api.github.com" | |
data = { | |
"title": "deploy", | |
"head": "develop", | |
"base": "master" | |
} | |
ghOrg = process.env.HUBOT_GITHUB_ORG | |
url = "#{url_api_base}/repos/#{ghOrg}/#{repo}/pulls" | |
github.post url, data, (response) -> | |
msg.send "本番にデプロイするプルリクエストを作成したよ!確認してマージしてね!" | |
msg.send response.html_url |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment