Skip to content

Commit 70e8a2b

Browse files
mokagioclaude
andcommitted
Type artifact_path as an Array
Review feedback: `is_string:` is deprecated. `type: Array` replaces both it and most of the `verify_block`, and fastlane converts a String into an array for us, so a single path still works — it splits on commas, which means a path containing one would be read as two. --- Generated with the help of Claude Code, https://claude.ai/code Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent fd9fe78 commit 70e8a2b

2 files changed

Lines changed: 4 additions & 7 deletions

File tree

lib/fastlane/plugin/wpmreleasetoolkit/actions/macos/macos_verify_code_signing.rb

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module Fastlane
77
module Actions
88
class MacosVerifyCodeSigningAction < Action
99
def self.run(params)
10-
paths = Array(params[:artifact_path])
10+
paths = params[:artifact_path]
1111
UI.user_error!('No artifact to verify: `artifact_path` is empty') if paths.empty?
1212

1313
paths.each do |path|
@@ -112,12 +112,9 @@ def self.available_options
112112
FastlaneCore::ConfigItem.new(
113113
key: :artifact_path,
114114
description: 'The path, or list of paths, to the `.app` bundle(s) or `.dmg` disk image(s) to verify',
115-
is_string: false,
115+
type: Array,
116116
verify_block: proc do |value|
117-
next if value.is_a?(String)
118-
next if value.is_a?(Array) && value.all?(String)
119-
120-
UI.user_error!('`artifact_path` must be a String or an Array of Strings')
117+
UI.user_error!('`artifact_path` must be a String or an Array of Strings') unless value.all?(String)
121118
end
122119
),
123120
FastlaneCore::ConfigItem.new(

spec/macos_verify_code_signing_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ def expect_stapler_validate(path, exitstatus: 0)
229229

230230
it 'fails when `artifact_path` is neither a String nor an Array' do
231231
expect { run_described_fastlane_action(artifact_path: 42) }
232-
.to raise_error(FastlaneCore::Interface::FastlaneError, /`artifact_path` must be a String or an Array of Strings/)
232+
.to raise_error(FastlaneCore::Interface::FastlaneError, /'artifact_path' value must be either `Array` or `comma-separated String`!/)
233233
end
234234

235235
it 'fails when `artifact_path` is an Array of something other than Strings' do

0 commit comments

Comments
 (0)