Skip to content

Commit 572ec20

Browse files
committed
Validate GitHub release asset paths
1 parent 291bee3 commit 572ec20

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

lib/fastlane/plugin/wpmreleasetoolkit/helper/github_helper.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,13 @@ def validate_release_assets!(assets)
423423
asset_paths = Array(assets)
424424
UI.user_error!('You must provide at least one release asset') if asset_paths.empty?
425425

426+
asset_paths.each do |file_path|
427+
UI.user_error!('release_assets must contain file paths') unless file_path.is_a?(String) && !file_path.empty?
428+
end
429+
430+
file_names = asset_paths.map { |file_path| File.basename(file_path) }
431+
UI.user_error!('release_assets must not contain duplicate filenames') if file_names.uniq.length != file_names.length
432+
426433
asset_paths.each do |file_path|
427434
UI.user_error!("Can't find file #{file_path}!") unless File.file?(file_path)
428435
end

0 commit comments

Comments
 (0)