@@ -9,16 +9,18 @@ def self.run(params)
9
9
pipeline_name = {
10
10
PIPELINE : params [ :pipeline_file ]
11
11
}
12
+ options = {
13
+ branch : params [ :branch ] ,
14
+ commit : params [ :commit ] ,
15
+ env : params [ :environment ] . merge ( pipeline_name ) ,
16
+ message : params [ :message ]
17
+ } . compact # remove entries with `nil` values from the Hash, if any
12
18
13
19
client = Buildkit . new ( token : params [ :buildkite_token ] )
14
20
response = client . create_build (
15
21
params [ :buildkite_organization ] ,
16
22
params [ :buildkite_pipeline ] ,
17
- {
18
- branch : params [ :branch ] ,
19
- commit : params [ :commit ] ,
20
- env : params [ :environment ] . merge ( pipeline_name )
21
- }
23
+ options
22
24
)
23
25
24
26
response . state == 'scheduled' ? UI . message ( 'Done!' ) : UI . crash! ( "Failed to start job\n Error: [#{ response } ]" )
@@ -64,6 +66,13 @@ def self.available_options
64
66
type : String ,
65
67
default_value : 'HEAD'
66
68
) ,
69
+ FastlaneCore ::ConfigItem . new (
70
+ key : :message ,
71
+ description : 'A custom message to show for the build in Buildkite\'s UI' ,
72
+ type : String ,
73
+ optional : true ,
74
+ default_value : nil
75
+ ) ,
67
76
FastlaneCore ::ConfigItem . new (
68
77
key : :pipeline_file ,
69
78
description : 'The name of the pipeline file in the project' ,
0 commit comments