Method: Kennel::GithubReporter#initialize

Defined in:
lib/kennel/github_reporter.rb

#initialize(token) ⇒ GithubReporter

Returns a new instance of GithubReporter.



14
15
16
17
18
19
# File 'lib/kennel/github_reporter.rb', line 14

def initialize(token)
  @token = token
  @git_sha = Utils.capture_sh("git rev-parse HEAD").strip
  origin = ENV["PROJECT_REPOSITORY"] || Utils.capture_sh("git remote -v").split("\n").first
  @repo_part = origin[%r{github\.com[:/](.+?)(\.git|$)}, 1] || raise("no origin found")
end