github_packages: Use hash compact

This commit is contained in:
Shaun Jackman 2021-04-02 18:01:42 -07:00
parent a3feb12712
commit 2b7824f7de
No known key found for this signature in database
GPG Key ID: D4ED5223F4E57996

View File

@ -205,10 +205,7 @@ class GitHubPackages
"org.opencontainers.image.url" => bottle_hash["formula"]["homepage"], "org.opencontainers.image.url" => bottle_hash["formula"]["homepage"],
"org.opencontainers.image.vendor" => org, "org.opencontainers.image.vendor" => org,
"org.opencontainers.image.version" => version, "org.opencontainers.image.version" => version,
} }.compact
formula_annotations_hash.each do |key, value|
formula_annotations_hash.delete(key) if value.blank?
end
manifests = bottle_hash["bottle"]["tags"].map do |bottle_tag, tag_hash| manifests = bottle_hash["bottle"]["tags"].map do |bottle_tag, tag_hash|
local_file = tag_hash["local_filename"] local_file = tag_hash["local_filename"]
@ -272,10 +269,7 @@ class GitHubPackages
"org.opencontainers.image.title" => "#{formula_full_name} #{tag}", "org.opencontainers.image.title" => "#{formula_full_name} #{tag}",
"com.github.package.type" => GITHUB_PACKAGE_TYPE, "com.github.package.type" => GITHUB_PACKAGE_TYPE,
"sh.brew.bottle.glibc.version" => glibc_version, "sh.brew.bottle.glibc.version" => glibc_version,
}).sort.to_h }).compact.sort.to_h
annotations_hash.each do |key, value|
annotations_hash.delete(key) if value.blank?
end
image_manifest = { image_manifest = {
schemaVersion: 2, schemaVersion: 2,