@@ -9,16 +9,18 @@ def self.run(params)
99 pipeline_name = {
1010 PIPELINE : params [ :pipeline_file ]
1111 }
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
1218
1319 client = Buildkit . new ( token : params [ :buildkite_token ] )
1420 response = client . create_build (
1521 params [ :buildkite_organization ] ,
1622 params [ :buildkite_pipeline ] ,
17- {
18- branch : params [ :branch ] ,
19- commit : params [ :commit ] ,
20- env : params [ :environment ] . merge ( pipeline_name )
21- }
23+ options
2224 )
2325
2426 response . state == 'scheduled' ? UI . message ( 'Done!' ) : UI . crash! ( "Failed to start job\n Error: [#{ response } ]" )
@@ -64,6 +66,13 @@ def self.available_options
6466 type : String ,
6567 default_value : 'HEAD'
6668 ) ,
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+ ) ,
6776 FastlaneCore ::ConfigItem . new (
6877 key : :pipeline_file ,
6978 description : 'The name of the pipeline file in the project' ,
0 commit comments