Github plugin for Cinch
This Cinch plugin will allow you to post to channels with notifications from github.
Installation
Add this line to your application's Gemfile:
gem 'cinch-github_notifications'
And then execute:
$ bundle
Usage
Add the plugin class to your bot setup and put some settings in there:
require 'cinch'
require 'cinch/plugins/github_notifications'
bot = Cinch::Bot.new do
configure do |c|
c.nick = "githubbot"
c.realname = "Tik-Tok"
c.server = "irc.freenode.net"
c.channels = %w{#channel1 #channel2}
c.plugins.plugins = [Cinch::Plugins::GithubNotifications::Poster]
c.plugins. = {
Cinch::Plugins::GithubNotifications::Poster => {
:bot => self, # This is vital
:github_credentials => {
# These are the arguments to Octokit::Client.new
# You can use oauth tokens too
:login => "bob",
:password => "password"
},
:announce => {
# List of regular expressions matched against the repo the notification came from
# Notifications relating to repos with the name starting "jphastings/" should have events posted to #channel1
%r{^jphastings/} => %w{#channel1},
# All events will post to #channel2
%r{} => %w{#channel2}
}
}
}
end
end
bot.start
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request