diff --git a/lib/puppet_metadata/github_actions.rb b/lib/puppet_metadata/github_actions.rb index 9dc1756..cde37ac 100644 --- a/lib/puppet_metadata/github_actions.rb +++ b/lib/puppet_metadata/github_actions.rb @@ -138,7 +138,7 @@ def puppet_version_below_minimum?(version) def os_release_to_beaker_setfile(os, release, puppet_collection) if options[:hosts] - setfiles = options[:hosts].collect do |host| + setfiles = options[:hosts].filter_map do |host| PuppetMetadata::Beaker.os_release_to_setfile( os, release, @@ -150,8 +150,7 @@ def os_release_to_beaker_setfile(os, release, puppet_collection) ) end - # check for os/release pairs that don't have a setfile - return setfiles[0] if setfiles[0].nil? + return if setfiles.empty? # merge the setfile strings [setfiles.collect { |setfile| setfile[0] }.join('-'), setfiles[0][1]]