Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

26 lines (21 sloc) 0.811 kB
class Service::HipChat < Service
string :auth_token, :room
boolean :notify
white_list :room
default_events :commit_comment, :download, :fork, :fork_apply, :gollum,
:issues, :issue_comment, :member, :public, :pull_request, :push, :watch
def receive_event
# make sure we have what we need
raise_config_error "Missing 'auth_token'" if data['auth_token'].to_s == ''
raise_config_error "Missing 'room'" if data['room'].to_s == ''
http.headers['X-GitHub-Event'] = event.to_s
res = http_post "https://api.hipchat.com/v1/webhooks/github",
:auth_token => data['auth_token'],
:room_id => data['room'],
:payload => JSON.generate(payload),
:notify => data['notify'] ? 1 : 0
if res.status < 200 || res.status > 299
raise_config_error
end
end
end
Jump to Line
Something went wrong with that request. Please try again.