From d481e72e85d5243b40c2a22c272c7e9f6404a568 Mon Sep 17 00:00:00 2001
From: Renaud Chaput <renchap@gmail.com>
Date: Fri, 7 Jul 2023 19:31:55 +0200
Subject: [PATCH] Tag images with the latest tag only when running against the
 latest stable branch (#25803)

---
 .github/workflows/build-image.yml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml
index 982031c9d8..f9dd36e36f 100644
--- a/.github/workflows/build-image.yml
+++ b/.github/workflows/build-image.yml
@@ -49,8 +49,10 @@ jobs:
           images: |
             tootsuite/mastodon
             ghcr.io/mastodon/mastodon
+          # Only tag with latest when ran against the latest stable branch
+          # This needs to be updated after each minor version release
           flavor: |
-            latest=auto
+            latest=${{ startsWith(github.ref, 'refs/tags/v4.1.') && 'auto' || 'false' }}
           tags: |
             type=edge,branch=main
             type=pep440,pattern={{raw}}
-- 
GitLab