From 96c1d41d2ed0c0def9e05f24f80a7fe14792596c Mon Sep 17 00:00:00 2001 From: Nick Mills-Barrett Date: Sun, 16 Aug 2026 22:04:49 +0100 Subject: [PATCH] Make per-bridge latest branches exclusive The override list was additive: main/master short-circuited to true before it was consulted, so a push to main still retagged latest and notified. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01XMVbxWZCy7VC3myitZi9Rv --- bridges.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bridges.go b/bridges.go index e68a3e2..0dd967b 100644 --- a/bridges.go +++ b/bridges.go @@ -103,9 +103,9 @@ var bridgeNotifications = map[BridgeType][]BridgeUpdateNotification{ Meowlnir: {}, } -// Branches other than main/master which are treated as the latest image, per bridge. -// These only apply to the listed bridge: a branch with the same name in any other -// bridge repo won't be retagged as latest nor notified about. +// The full set of branches treated as the latest image, per bridge. A bridge listed +// here uses only these branches: main/master are not implicitly included, so pushes +// to them are neither retagged as latest nor notified about. var bridgeLatestBranchOverrides = map[BridgeType][]string{ BridgeDiscord: {"megadiscord"}, BridgeGoogleMessages: {"experimental"}, @@ -132,10 +132,10 @@ var targetImageRepoOverrides = map[BridgeType]string{ } func (bridgeType BridgeType) IsLatestBranch(branch string) bool { - if branch == "main" || branch == "master" { - return true + if overrides, ok := bridgeLatestBranchOverrides[bridgeType]; ok { + return slices.Contains(overrides, branch) } - return slices.Contains(bridgeLatestBranchOverrides[bridgeType], branch) + return branch == "main" || branch == "master" } func (bridgeType BridgeType) NotificationTargets() []BridgeUpdateNotification {