From 3a7e658a8c57bd7844e6d002babd278161f35c43 Mon Sep 17 00:00:00 2001 From: Ian Maia Date: Mon, 15 Dec 2025 19:47:22 +0100 Subject: [PATCH 1/2] Use `.` for sourcing env files as the POSIX compliant command --- .../actions/common/buildkite_pipeline_upload_action.rb | 4 +++- spec/buildkite_pipeline_upload_action_spec.rb | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/buildkite_pipeline_upload_action.rb b/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/buildkite_pipeline_upload_action.rb index 5e1d34457..2361cc04a 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/buildkite_pipeline_upload_action.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/buildkite_pipeline_upload_action.rb @@ -21,7 +21,9 @@ def self.run(params) if env_file && File.exist?(env_file) UI.message(" - Sourcing environment file beforehand: #{env_file}") - sh(environment, "source #{env_file.shellescape} && buildkite-agent pipeline upload #{pipeline_file.shellescape}") + # Use `.` instead of `source` for POSIX compliance - works across all shells (sh/dash/bash/zsh) + # while `source` isn't always present + sh(environment, ". #{env_file.shellescape} && buildkite-agent pipeline upload #{pipeline_file.shellescape}") else sh(environment, 'buildkite-agent', 'pipeline', 'upload', pipeline_file) end diff --git a/spec/buildkite_pipeline_upload_action_spec.rb b/spec/buildkite_pipeline_upload_action_spec.rb index 4721c8d65..ddad9e87b 100644 --- a/spec/buildkite_pipeline_upload_action_spec.rb +++ b/spec/buildkite_pipeline_upload_action_spec.rb @@ -60,7 +60,7 @@ allow(File).to receive(:exist?).with(env_file).and_return(true) expect(Fastlane::Action).to receive(:sh).with( environment, - "source #{env_file.shellescape} && buildkite-agent pipeline upload #{loaded_pipeline_file.shellescape}" + ". #{env_file.shellescape} && buildkite-agent pipeline upload #{loaded_pipeline_file.shellescape}" ) expect_upload_pipeline_message expect_sourcing_env_file_message(env_file) @@ -92,7 +92,7 @@ allow(File).to receive(:exist?).with(env_file).and_return(true) expect(Fastlane::Action).to receive(:sh).with( environment_default, - "source #{env_file.shellescape} && buildkite-agent pipeline upload #{loaded_pipeline_file.shellescape}" + ". #{env_file.shellescape} && buildkite-agent pipeline upload #{loaded_pipeline_file.shellescape}" ) expect_upload_pipeline_message expect_sourcing_env_file_message(env_file) @@ -122,7 +122,7 @@ allow(File).to receive(:exist?).with(env_file_default).and_return(true) expect(Fastlane::Action).to receive(:sh).with( environment_default, - "source #{env_file_default} && buildkite-agent pipeline upload #{loaded_pipeline_file.shellescape}" + ". #{env_file_default} && buildkite-agent pipeline upload #{loaded_pipeline_file.shellescape}" ) expect_upload_pipeline_message expect_sourcing_env_file_message(env_file_default) From 5a2864d752b05f9b4e9dab559dfe5ff8b0553a13 Mon Sep 17 00:00:00 2001 From: Ian Maia Date: Mon, 15 Dec 2025 19:53:57 +0100 Subject: [PATCH 2/2] Update CHANGELOG --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 87eb23f77..bd321484a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ _None_ ### Bug Fixes -_None_ +- `buildkite_pipeline_upload`: Fix compatibility issues by using POSIX-compliant `.` instead of bash-specific `source` command. [#681] ### Internal Changes