Fix actual-budget listing ref and keep bump refs in sync (#34)
The bump bot updated the digest in cottage.yml but kept the old ref, so Cottage's sync skipped actual-budget (template uses 26.11.0, listing recorded 25.11.0). Correct the ref, make the bot rewrite it with the digest, and add a CI check for Cottage's listing-image rule.
This commit is contained in:
1 parent
2868418a60
commit
6262b8b648
4 files changed
+37
-3
No files matched your search
+4
-2
@@ -220,10 +220,12 @@ def apply_bump(slug, cur, new, t, images, version):
|
||||
if cur in rest or old_tag in rest:
|
||||
return "the old version is used elsewhere in template.yml"
|
||||
tpl = tpl.replace(old_ref, new_ref).replace(f'version: "{version}"', f'version: "{new}-c1"')
|
||||
pat = re.compile(r"(- ref: " + re.escape(old_ref) + r"\n\s+digest: )sha256:[0-9a-f]{64}")
|
||||
pat = re.compile(r"(- ref: )" + re.escape(old_ref) + r"(\n\s+digest: )sha256:[0-9a-f]{64}")
|
||||
if not pat.search(cot):
|
||||
return "digest line not found in cottage.yml"
|
||||
cot = pat.sub(lambda m: m.group(1) + digest, cot)
|
||||
# The listing's ref must change with the template's: Hearth refuses a recipe whose
|
||||
# template uses an image the listing has no digest for.
|
||||
cot = pat.sub(lambda m: m.group(1) + new_ref + m.group(2) + digest, cot)
|
||||
open(tp, "w").write(tpl)
|
||||
open(cp, "w").write(cot)
|
||||
return old_ref, new_ref, digest
|
||||
|
||||
Reference in new issue
Block a user