diff --git a/Library/Homebrew/github_packages.rb b/Library/Homebrew/github_packages.rb index 39625162c5..bc74d0fab2 100644 --- a/Library/Homebrew/github_packages.rb +++ b/Library/Homebrew/github_packages.rb @@ -424,6 +424,7 @@ class GitHubPackages end index_json_sha256, index_json_size = write_image_index(manifests, blobs, formula_annotations_hash) + raise "Image index too large!" if index_json_size >= 4 * 1024 * 1024 # GitHub will error 500 if too large write_index_json(index_json_sha256, index_json_size, root, "org.opencontainers.image.ref.name" => version_rebuild) diff --git a/Library/Homebrew/keg_relocate.rb b/Library/Homebrew/keg_relocate.rb index 59ffeab115..bbb2f87d9b 100644 --- a/Library/Homebrew/keg_relocate.rb +++ b/Library/Homebrew/keg_relocate.rb @@ -34,7 +34,7 @@ class Keg @replacement_map.fetch(key) end - sig { params(text: String).void } + sig { params(text: String).returns(T::Boolean) } def replace_text(text) replacements = @replacement_map.values.to_h @@ -47,7 +47,7 @@ class Keg changed = text.gsub!(key, replacements[key]) any_changed ||= changed end - any_changed + !any_changed.nil? end sig { params(path: T.any(String, Regexp)).returns(Regexp) }