Skip to content

Instantly share code, notes, and snippets.

@edorcutt
Created August 16, 2011 20:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edorcutt/1150103 to your computer and use it in GitHub Desktop.
Save edorcutt/1150103 to your computer and use it in GitHub Desktop.
Kynetx Github commit webhook
ruleset a169xXXX {
meta {
name "KySQLGitHook"
description <<
Kynetx Github commit webhook
>>
author "Ed Orcutt, LOBOSLLC"
logging on
key twitter {
"consumer_key" : "YOUR KEY HERE",
"consumer_secret" : "YOUR KEY SECRET HERE",
"oauth_token" : "YOUR TOKEN HERE",
"oauth_token_secret" : "YOUR TOKEN SECRET HERE"
}
}
dispatch { }
global { }
// ------------------------------------------------------------------------
rule GitCommit {
select when webhook gitcommit
foreach (event:param("payload")).decode().pick("$.commits") setting (commit)
pre {
commitAuthor = commit.pick("$.author.name", true).head();
commitMessage = commit.pick("$.message", true).head();
commitURL = commit.pick("$.url", true).head();
msg = <<
KySQL commit by #{commitAuthor} - #{commitMessage} #{commitURL}
>>;
}
{
twitter:update(msg);
}
}
// ------------------------------------------------------------------------
// Beyond here there be dragons :)
// ------------------------------------------------------------------------
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment