fix: prevent partial pushes causing partial changelogs (#1880)

This commit is contained in:
Antheas Kapenekakis 2024-11-16 06:07:53 +01:00 committed by GitHub
parent 767d8c1492
commit c57f6cd8c3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -131,8 +131,9 @@ def get_manifests(target: str):
def get_tags(target: str, manifests: dict[str, Any]):
tags = set()
for manifest in manifests.values():
for tag in manifest["RepoTags"]:
# Select random manifest to get reference tags from
first = next(iter(manifests.values()))
for tag in first["RepoTags"]:
# Tags ending with .0 should not exist
if tag.endswith(".0"):
continue
@ -143,6 +144,12 @@ def get_tags(target: str, manifests: dict[str, Any]):
if re.match(STABLE_START_PATTERN, tag):
tags.add(tag)
# Remove tags not present in all images
for manifest in manifests.values():
for tag in list(tags):
if tag not in manifest["RepoTags"]:
tags.remove(tag)
tags = list(sorted(tags))
assert len(tags) > 2, "No current and previous tags found"
return tags[-2], tags[-1]