Skip to content

Instantly share code, notes, and snippets.

@elifoster
Last active July 26, 2016 01:57
Show Gist options
  • Save elifoster/5bd78d57f972656fbbadcd11774aeb13 to your computer and use it in GitHub Desktop.
Save elifoster/5bd78d57f972656fbbadcd11774aeb13 to your computer and use it in GitHub Desktop.
A simple script to add the issues event to the IRC service on a repository.
require 'octokit'
# Enter your login stuff and uncomment accordingly.
# @kit = Octokit::Client.new(access_token: 'token')
# @kit = Octokit::Client.new(login: 'user', password: 'password')
# Adds the issues event to the IRC web service for the repository.
# @param repo [String] The full repository name (e.g., elifoster/seedcopy)
# @return [void]
def irc(repo)
id = nil
@kit.hooks(repo).each do |hook|
id = hook[:id] if hook[:name] == 'irc'
end
@kit.edit_hook(repo, id, 'irc', {}, { add_events: ['issues'] })
end
# Enter your repository accordingly.
irc('username/repository')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment