Skip to content

Commit 9c05daf

Browse files
authored
Merge pull request #392 from wordpress-mobile/builkite_trigger/custom_message
Add the ability for the `buildkite_trigger_build` action to provide a custom message
2 parents eee6689 + 2e8587d commit 9c05daf

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ _None_
1111
### New Features
1212

1313
- Add `tools:ignore="InconsistentArrays"` to `available_languages.xml` to avoid a linter warning on repos hosting multiple app flavors. [#390]
14+
- Add the ability to provide a custom message for builds triggered via `buildkite_trigger_build` action [#392]
1415

1516
### Bug Fixes
1617
* Fixes milestones being compared as strings instead of integers in `github_helper.get_last_milestone` [#391]

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

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

Comments
 (0)