Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

27 lines (21 sloc) 0.679 kb
class Service::PivotalTracker < Service
string :token, :branch, :endpoint
white_list :endpoint, :branch
def receive_push
token = data['token']
branches = data['branch'].to_s.split(/\s+/)
ref = payload["ref"].to_s
notify if branches.empty? || branches.include?(ref.split("/").last)
end
def notify
endpoint = data['endpoint'].to_s
endpoint = 'https://www.pivotaltracker.com/services/v3/github_commits' if endpoint.empty?
res = http_post endpoint do |req|
req.params[:token] = data['token']
req.body = {:payload => payload.to_json}
end
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.