Skip to content

Commit be3aa8a

Browse files
committed
fix(release): use tracked embedded models catalog
Avoid overriding the embedded models catalog during tagged builds so releases cannot panic at startup due to invalid external catalog data.
1 parent 3a4bfcf commit be3aa8a

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

.github/workflows/release.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ jobs:
1616
- uses: actions/checkout@v4
1717
with:
1818
fetch-depth: 0
19-
- name: Refresh models catalog
20-
run: |
21-
git fetch --depth 1 https://github.com/router-for-me/models.git main
22-
git show FETCH_HEAD:models.json > internal/registry/models/models.json
2319
- run: git fetch --force --tags
2420
- uses: actions/setup-go@v4
2521
with:
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package registry
2+
3+
import "testing"
4+
5+
func TestEmbeddedModelsCatalogPassesStartupValidation(t *testing.T) {
6+
if len(embeddedModelsJSON) == 0 {
7+
t.Fatal("embedded models catalog is empty")
8+
}
9+
10+
if err := loadModelsFromBytes(embeddedModelsJSON, "test"); err != nil {
11+
t.Fatalf("embedded models catalog should pass startup validation: %v", err)
12+
}
13+
}

0 commit comments

Comments
 (0)