pr-upload: fix --warn-on-upload-failure functionality

For bottle uploads that would be skipped due to preupload_check warning about
skipped uploads and returning early, the old code errored out due to JSON schema
validation failure since the upload was allowed to resume:

    "error"=>"value at /manifests/0/annotations/org.opencontainers.image.ref.name is not a string"

This change ensures that the upload is effectively skipped if preupload_check
returns no result.
This commit is contained in:
Mislav Marohnić 2025-01-11 01:25:00 +01:00
parent 6aac197d55
commit 450469f57f
No known key found for this signature in database

View File

@ -260,6 +260,8 @@ class GitHubPackages
# We run the preupload check twice to prevent TOCTOU bugs.
result = preupload_check(user, token, skopeo, formula_full_name, bottle_hash,
keep_old:, dry_run:, warn_on_error:)
# Skip upload if preupload check returned early.
return if result.nil?
formula_name, org, repo, version, rebuild, version_rebuild, image_name, image_uri, keep_old = *result