Created
August 16, 2011 20:34
-
-
Save edorcutt/1150103 to your computer and use it in GitHub Desktop.
Kynetx Github commit webhook
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
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