Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions spec/buildkite_pipeline_upload_action_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down