summaryrefslogtreecommitdiff
path: root/scripts/api/commit_merge_requests.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-02-20 12:12:47 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-02-20 12:12:47 +0000
commitc984b0faf409dbe91a7998260fe4b8299cf21ad4 (patch)
treeb1e434732c9d94ecaab0727f56a811b80a61a371 /scripts/api/commit_merge_requests.rb
parentbd28d0fa02dc73794e013159512900f8d10fa10b (diff)
downloadgitlab-ce-c984b0faf409dbe91a7998260fe4b8299cf21ad4.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'scripts/api/commit_merge_requests.rb')
-rw-r--r--scripts/api/commit_merge_requests.rb19
1 files changed, 4 insertions, 15 deletions
diff --git a/scripts/api/commit_merge_requests.rb b/scripts/api/commit_merge_requests.rb
index 3cf8dc87497..523d2e769f0 100644
--- a/scripts/api/commit_merge_requests.rb
+++ b/scripts/api/commit_merge_requests.rb
@@ -1,22 +1,11 @@
# frozen_string_literal: true
-require 'gitlab'
-require_relative 'default_options'
+require_relative 'base'
-class CommitMergeRequests
+class CommitMergeRequests < Base
def initialize(options)
- @project = options.fetch(:project)
+ super
@sha = options.fetch(:sha)
-
- # If api_token is nil, it's set to '' to allow unauthenticated requests (for forks).
- api_token = options.fetch(:api_token, '')
-
- warn "No API token given." if api_token.empty?
-
- @client = Gitlab.client(
- endpoint: options.fetch(:endpoint, API::DEFAULT_OPTIONS[:endpoint]),
- private_token: api_token
- )
end
def execute
@@ -25,5 +14,5 @@ class CommitMergeRequests
private
- attr_reader :project, :sha, :client
+ attr_reader :sha
end