Created
January 31, 2015 14:36
-
-
Save joshrp/89394d5012851accbb4c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
var githubhook = require('githubhook'); | |
var github = githubhook({/* options */}); | |
github.listen(); | |
var mergeRegex = /^Merge pull request (#\d)+ from/; | |
github.on('*', function (event, repo, ref, data) { | |
console.log('Hook received for',repo); | |
var head = data.head_commit; | |
var pusher = data.pusher.name; | |
var matches = mergeRegex.exec(head.message); | |
if (matches === null) { | |
console.log('commit pushed', head.id.substr(0,8)); | |
} else { | |
console.log('Pull request merged', matches[1]); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment