From ee9b7d99617375b30f5c9ec966c9d79efd4263a9 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Wed, 30 Oct 2024 13:19:50 +1100 Subject: [PATCH] Run `buildkite_pipeline_upload` on branch HEAD --- fastlane/lanes/release.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/fastlane/lanes/release.rb b/fastlane/lanes/release.rb index 970df0f49..0e05c73d1 100644 --- a/fastlane/lanes/release.rb +++ b/fastlane/lanes/release.rb @@ -336,8 +336,14 @@ def trigger_buildkite_release_build(branch:, beta:) if is_ci buildkite_pipeline_upload( pipeline_file: File.join(PROJECT_ROOT_FOLDER, '.buildkite', pipeline_file_name), - # Both keys and values need to be passed as strings - environment: environment.to_h { |k, v| [k.to_s, v.to_s] } + environment: + # Override the commit to make sure it runs on the latest state, + # not the commit that triggered the automation that eventaully called this. + # + # Useful during release automation builds that make additional commits to the release branch. + { **environment, BUILDKITE_COMMIT: last_git_commit[:commit_hash] } + # Both keys and values need to be passed as strings + .to_h { |k, v| [k.to_s, v.to_s] } ) else build_url = buildkite_trigger_build(