diff --git a/Library/Homebrew/software_spec.rb b/Library/Homebrew/software_spec.rb index 5b7afa1901..7161c8a036 100644 --- a/Library/Homebrew/software_spec.rb +++ b/Library/Homebrew/software_spec.rb @@ -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?