From 03e4a53332315caad3788dbde6da4d61aa25a670 Mon Sep 17 00:00:00 2001 From: Michael Barz Date: Wed, 18 Nov 2026 15:13:47 +0100 Subject: [PATCH] ci: make the latest docker tag explicit on stable-9.1 (#4051) stable-9.1 is the newest production branch and keeps moving latest. Set tag_latest to False once a newer production branch exists. --- .woodpecker.star | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.woodpecker.star b/.woodpecker.star index b509f87279..3b5d32be34 100644 --- a/.woodpecker.star +++ b/.woodpecker.star @@ -470,6 +470,9 @@ config = { # NOTE: need to be set to true if patch releases are made from stable-X-branches "skip_rolling": True, "skip_daily": True, + # only the newest production branch may move the "latest" tag + # NOTE: set to False once a newer production branch exists + "tag_latest": True, "repo": docker_repo_slug, "build_type": "production", }, @@ -1896,7 +1899,13 @@ def dockerRelease(ctx, repo, build_type): # if a tag has something appended with "-" i.e. alpha, beta, rc1... # set the entire string as tag, else tag with latest (same as empty with current plugin) - hard_tag = tag_version if len(tag_parts) > 1 else "latest" + if len(tag_parts) > 1: + hard_tag = tag_version + elif build_type == "production" and not config["dockerReleases"]["production"].get("tag_latest", True): + # older production branch: auto_tag already adds X, X.Y and X.Y.Z, don't touch latest + hard_tag = tag_version + else: + hard_tag = "latest" depends_on = getPipelineNames(getGoBinForTesting(ctx))