Skip to content
Browse files

Notify IRC on new tags.

  • Loading branch information...
1 parent 17cfa4e commit c26665aaa6448cc13a5b91e41d7553286fa04856 James Socol committed Oct 26, 2011
Showing with 9 additions and 1 deletion.
  1. +9 −1 jig.js
View
10 jig.js
@@ -14,7 +14,8 @@ var http = require('http'),
IniReader = require('inireader').IniReader,
GitHubApi = require('github').GitHubApi,
github = new GitHubApi(),
- PULLREQRE = /pull\s+(?:req\s+)?#?(\d+)/i;
+ PULLREQRE = /pull\s+(?:req\s+)?#?(\d+)/i,
+ TAGRE = /\/tags\/(.+)$/i;
inireader = new IniReader();
inireader.load(options.config);
@@ -157,6 +158,13 @@ var server = http.createServer(function(req, res) {
console.log(err);
});
}, 5000);
+ } else if (TAGRE.test(data.ref)) {
+ var m = TAGRE.exec(data.ref),
+ tag = '\002New Tag:\002 \00312%(tag)s\003 pushed by \00303%(pusher)s\003',
+ tagMsg = interpolate(tag, {'tag': m[1], 'pusher': data.pusher.name}, true);
+ CHANNELS.forEach(function(c) {
+ client.say(c, tagMsg);
+ });
}
});
});

0 comments on commit c26665a

Please sign in to comment.
Something went wrong with that request. Please try again.