Merge pull request #11471 from Bo98/ghp-tab-fix

software_spec: fix wrong tab being fetched when bottle isn't unique
This commit is contained in:
Mike McQuaid 2021-06-01 13:59:06 +01:00 committed by GitHub
commit be7d890970
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -386,8 +386,11 @@ class Bottle
raise ArgumentError, "Missing 'annotations' section." if manifests_annotations.blank?
bottle_digest = @resource.checksum.hexdigest
image_ref = GitHubPackages.version_rebuild(@resource.version, rebuild, @tag.to_s)
manifest_annotations = manifests_annotations.find do |m|
m["sh.brew.bottle.digest"] == bottle_digest
next if m["sh.brew.bottle.digest"] != bottle_digest
m["org.opencontainers.image.ref.name"] == image_ref
end
raise ArgumentError, "Couldn't find manifest matching bottle checksum." if manifest_annotations.blank?