Skip to content

Commit

Permalink
Notify IRC on new tags.
Browse files Browse the repository at this point in the history
  • Loading branch information
James Socol committed Oct 26, 2011
1 parent 17cfa4e commit c26665a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion jig.js
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
});
}
});
});
Expand Down

0 comments on commit c26665a

Please sign in to comment.