summaryrefslogtreecommitdiff
path: root/app/controllers/import/github_controller.rb
diff options
context:
space:
mode:
authorMartin Hanzel <mhanzel@gitlab.com>2019-07-25 12:59:37 +0200
committerMartin Hanzel <mhanzel@gitlab.com>2019-07-25 12:59:37 +0200
commit8201593066c5b932d7f998da5c07ea91e25a15cc (patch)
tree0204ab6ff6f506ff43c95855605dc056d68d8b2a /app/controllers/import/github_controller.rb
parent979f0842653fa6b48a88cb6286a2145654d8e197 (diff)
parent0ec40a68b73cbf14b34e55ee2a54df1f47c19cfb (diff)
downloadgitlab-ce-mh/editor-indents.tar.gz
Merge commit '0ec40a68b73cbf14b34e55ee2a54df1f47c19cfb' into mh/editor-indentsmh/editor-indents-reviewmh/editor-indents
Diffstat (limited to 'app/controllers/import/github_controller.rb')
-rw-r--r--app/controllers/import/github_controller.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/controllers/import/github_controller.rb b/app/controllers/import/github_controller.rb
index aa4aa0fbdac..ebb50fc8b10 100644
--- a/app/controllers/import/github_controller.rb
+++ b/app/controllers/import/github_controller.rb
@@ -10,7 +10,7 @@ class Import::GithubController < Import::BaseController
rescue_from Octokit::Unauthorized, with: :provider_unauthorized
def new
- if github_import_configured? && logged_in_with_provider?
+ if !ci_cd_only? && github_import_configured? && logged_in_with_provider?
go_to_provider_for_permissions
elsif session[access_token_key]
redirect_to status_import_url
@@ -169,11 +169,15 @@ class Import::GithubController < Import::BaseController
# rubocop: enable CodeReuse/ActiveRecord
def provider_auth
- if session[access_token_key].blank?
+ if !ci_cd_only? && session[access_token_key].blank?
go_to_provider_for_permissions
end
end
+ def ci_cd_only?
+ %w[1 true].include?(params[:ci_cd_only])
+ end
+
def client_options
{}
end