class Dude::CodeManagement::Github::Client

Public Instance Methods

client() click to toggle source
# File lib/dude/code_management/github/client.rb, line 9
def client
  @client ||= Faraday.new('https://api.github.com/', {
    headers: { Authorization: "token #{Dude::SETTINGS.dig(:github, :token)}" }
  })
end
create_pull_request(issue:, owner:, repo:, params:) click to toggle source
# File lib/dude/code_management/github/client.rb, line 15
def create_pull_request(issue:, owner:, repo:, params:)
  CreatePullRequest.new.call(client, issue: issue, owner: owner, repo: repo, params: params)
end
health_check() click to toggle source
# File lib/dude/code_management/github/client.rb, line 19
def health_check
  client.get('https://api.github.com/user').status == 200
rescue StandardError
  false
end