Skip to content

Instantly share code, notes, and snippets.

@dend
Created April 16, 2017 17:56
Show Gist options
  • Save dend/4f2eb7e2cbcd35877dba561ae450ab68 to your computer and use it in GitHub Desktop.
Save dend/4f2eb7e2cbcd35877dba561ae450ab68 to your computer and use it in GitHub Desktop.
// Check if we have a push event in place. That is a standard commit.
if (req.headers["x-github-event"] && req.headers["x-github-event"].toLowerCase() === "push")
{
console.log("This is a push event for commit: " + bodyObject.after);
bot.getCommit(bodyObject.after, function(result){
console.log("Commit obtained!");
for(var i = 0; i < result.files.length; i++){
var file = result.files[i];
if (file.status.toLowerCase() === 'added' &&
file.filename.indexOf(config.relativeFolder + "/",0) === 0 &&
file.filename.split('.').pop().toLowerCase() === 'md'){
console.log("Got us a Markdown file!");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment