@@ -11,14 +11,17 @@ def self.run(params)
1111 }
1212
1313 client = Buildkit . new ( token : params [ :buildkite_token ] )
14+ options = {
15+ branch : params [ :branch ] ,
16+ commit : params [ :commit ] ,
17+ env : params [ :environment ] . merge ( pipeline_name ) ,
18+ message : params [ :message ]
19+ } . compact # remove entries with `nil` values from the Hash, if any
20+
1421 response = client . create_build (
1522 params [ :buildkite_organization ] ,
1623 params [ :buildkite_pipeline ] ,
17- {
18- branch : params [ :branch ] ,
19- commit : params [ :commit ] ,
20- env : params [ :environment ] . merge ( pipeline_name )
21- }
24+ options
2225 )
2326
2427 response . state == 'scheduled' ? UI . message ( 'Done!' ) : UI . crash! ( "Failed to start job\n Error: [#{ response } ]" )
@@ -64,6 +67,13 @@ def self.available_options
6467 type : String ,
6568 default_value : 'HEAD'
6669 ) ,
70+ FastlaneCore ::ConfigItem . new (
71+ key : :message ,
72+ description : 'A custom message to show for the build in Buildkite\'s UI' ,
73+ type : String ,
74+ optional : true ,
75+ default_value : nil
76+ ) ,
6777 FastlaneCore ::ConfigItem . new (
6878 key : :pipeline_file ,
6979 description : 'The name of the pipeline file in the project' ,
0 commit comments