Set the GitHub API token on options hash

parent 81262052
...@@ -44,13 +44,13 @@ module Github ...@@ -44,13 +44,13 @@ module Github
attr_reader :project, :repository, :repo, :repo_url, :wiki_url, attr_reader :project, :repository, :repo, :repo_url, :wiki_url,
:options, :errors, :cached, :verbose :options, :errors, :cached, :verbose
def initialize(project, options) def initialize(project, options = {})
@project = project @project = project
@repository = project.repository @repository = project.repository
@repo = project.import_source @repo = project.import_source
@repo_url = project.import_url @repo_url = project.import_url
@wiki_url = project.import_url.sub(/\.git\z/, '.wiki.git') @wiki_url = project.import_url.sub(/\.git\z/, '.wiki.git')
@options = options @options = options.reverse_merge(token: project.import_data&.credentials&.fetch(:user))
@verbose = options.fetch(:verbose, false) @verbose = options.fetch(:verbose, false)
@cached = Hash.new { |hash, key| hash[key] = Hash.new } @cached = Hash.new { |hash, key| hash[key] = Hash.new }
@errors = [] @errors = []
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment