Skip to content

Commit 2999f4f

Browse files
Fizzadarclaude
andcommitted
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) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XMVbxWZCy7VC3myitZi9Rv
1 parent 516c55b commit 2999f4f

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

bridges.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ var bridgeNotifications = map[BridgeType][]BridgeUpdateNotification{
103103
Meowlnir: {},
104104
}
105105

106-
// Branches other than main/master which are treated as the latest image, per bridge.
107-
// These only apply to the listed bridge: a branch with the same name in any other
108-
// bridge repo won't be retagged as latest nor notified about.
106+
// The full set of branches treated as the latest image, per bridge. A bridge listed
107+
// here uses only these branches: main/master are not implicitly included, so pushes
108+
// to them are neither retagged as latest nor notified about.
109109
var bridgeLatestBranchOverrides = map[BridgeType][]string{
110110
BridgeDiscord: {"megadiscord"},
111111
BridgeGoogleMessages: {"experimental"},
@@ -132,10 +132,10 @@ var targetImageRepoOverrides = map[BridgeType]string{
132132
}
133133

134134
func (bridgeType BridgeType) IsLatestBranch(branch string) bool {
135-
if branch == "main" || branch == "master" {
136-
return true
135+
if overrides, ok := bridgeLatestBranchOverrides[bridgeType]; ok {
136+
return slices.Contains(overrides, branch)
137137
}
138-
return slices.Contains(bridgeLatestBranchOverrides[bridgeType], branch)
138+
return branch == "main" || branch == "master"
139139
}
140140

141141
func (bridgeType BridgeType) NotificationTargets() []BridgeUpdateNotification {

0 commit comments

Comments
 (0)