Fix token interpolation when setting the Github remote
This commit is contained in:
parent
ea5d43a3b8
commit
c5e4e676e3
1 changed files with 2 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
||||||
require_relative 'error'
|
require_relative 'error'
|
||||||
|
|
||||||
module Github
|
module Github
|
||||||
class Import
|
class Import
|
||||||
include Gitlab::ShellAdapter
|
include Gitlab::ShellAdapter
|
||||||
|
@ -79,7 +80,7 @@ module Github
|
||||||
def fetch_repository
|
def fetch_repository
|
||||||
begin
|
begin
|
||||||
project.create_repository unless project.repository.exists?
|
project.create_repository unless project.repository.exists?
|
||||||
project.repository.add_remote('github', "https://{options.fetch(:token)}@github.com/#{repo}.git")
|
project.repository.add_remote('github', "https://#{options.fetch(:token)}@github.com/#{repo}.git")
|
||||||
project.repository.set_remote_as_mirror('github')
|
project.repository.set_remote_as_mirror('github')
|
||||||
project.repository.fetch_remote('github', forced: true)
|
project.repository.fetch_remote('github', forced: true)
|
||||||
rescue Gitlab::Shell::Error => e
|
rescue Gitlab::Shell::Error => e
|
||||||
|
|
Loading…
Reference in a new issue