debian-mirror-gitlab/lib/gitlab/ci/pipeline/chain/remove_unwanted_chat_jobs.rb
2019-07-07 11:18:12 +05:30

25 lines
610 B
Ruby

# frozen_string_literal: true
module Gitlab
module Ci
module Pipeline
module Chain
class RemoveUnwantedChatJobs < Chain::Base
def perform!
return unless pipeline.config_processor && pipeline.chat?
# When scheduling a chat pipeline we only want to run the build
# that matches the chat command.
pipeline.config_processor.jobs.select! do |name, _|
name.to_s == command.chat_data[:command].to_s
end
end
def break?
false
end
end
end
end
end
end