Skip to content

Commit 9f8621c

Browse files
committed
Still return the key if file already existed and we skipped the upload
1 parent a8c3d3a commit 9f8621c

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def self.run(params)
2727
else
2828
UI.user_error!(message)
2929
end
30-
return
30+
return key
3131
end
3232

3333
UI.message("Uploading #{file_path} to: #{key}")

spec/upload_to_s3_spec.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,14 @@ def stub_s3_response_for_file(key, exists: true)
167167
allow(FastlaneCore::UI).to receive(:important) { |message| warnings << message }
168168

169169
with_tmp_file(named: 'key') do |file_path|
170-
run_described_fastlane_action(
170+
key = run_described_fastlane_action(
171171
bucket: test_bucket,
172172
key: 'key',
173173
file: file_path,
174174
skip_if_exists: true
175175
)
176-
expect(warnings).to eq ["File already exists in S3 bucket #{test_bucket} at #{expected_key}. Skipping upload."]
176+
expect(warnings).to eq(["File already exists in S3 bucket #{test_bucket} at #{expected_key}. Skipping upload."])
177+
expect(key).to eq(expected_key)
177178
end
178179
end
179180
end

0 commit comments

Comments
 (0)