Skip to content

Commit 55bdc9b

Browse files
committed
Add the ability for the buildkite_trigger_build action to provide a custom message
1 parent b4bfe77 commit 55bdc9b

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

lib/fastlane/plugin/wpmreleasetoolkit/actions/common/buildkite_trigger_build_action.rb

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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\nError: [#{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

Comments
 (0)