Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
27 lines (21 sloc) 916 Bytes
class Service::Buildcoin < Service
string :company_key
default_events :push, :pull_request, :pull_request_review_comment, :issue_comment
def receive_event
raise_config_error "Missing Company API Key" if data['company_key'].to_s == ''
if event.to_s.eql? 'push'
url = "https://buildcoin.com/hooks/#{data['company_key']}/github/push"
elsif event.to_s.eql? 'pull_request'
url = "https://buildcoin.com/hooks/#{data['company_key']}/github/pullrequest"
elsif event.to_s.eql? 'pull_request_review_comment'
url = "https://buildcoin.com/hooks/#{data['company_key']}/github/pullrequest/reviewcomment"
elsif event.to_s.eql? 'issue_comment'
url = "https://buildcoin.com/hooks/#{data['company_key']}/github/pullrequest/issuecomment"
end
res = http_post url,
{'payload' => payload.to_json}
if res.status != 200
raise_config_error
end
end
end
Something went wrong with that request. Please try again.