blob: 3ec6eee9f547aea52c6efe2ba7aec9b8165ad145 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# frozen_string_literal: true
module Mutations
module Ci
module Pipeline
class Cancel < Base
graphql_name 'PipelineCancel'
authorize :update_pipeline
def resolve(id:)
pipeline = authorized_find!(id: id)
if pipeline.cancelable?
pipeline.cancel_running
pipeline.cancel
{ success: true, errors: [] }
else
{ success: false, errors: ['Pipeline is not cancelable'] }
end
end
end
end
end
end
|