fix(release): restrict checksum artifact matching

Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
Virgil 2026-04-01 16:36:40 +00:00
parent ba6ac633ff
commit 4e664e62b5
2 changed files with 14 additions and 1 deletions

View file

@ -212,7 +212,7 @@ func shouldPublishArchive(name string) bool {
}
func shouldPublishChecksum(name string) bool {
return core.HasSuffix(name, ".txt")
return name == "CHECKSUMS.txt"
}
func shouldPublishSignature(name string) bool {

View file

@ -71,6 +71,19 @@ func TestRelease_FindArtifacts_Good(t *testing.T) {
assert.Contains(t, artifacts[0].Path, "CHECKSUMS.txt")
})
t.Run("ignores unrelated text files", func(t *testing.T) {
dir := t.TempDir()
distDir := ax.Join(dir, "dist")
require.NoError(t, ax.MkdirAll(distDir, 0755))
require.NoError(t, ax.WriteFile(ax.Join(distDir, "release-notes.txt"), []byte("notes"), 0644))
artifacts, err := findArtifacts(io.Local, distDir)
require.NoError(t, err)
assert.Empty(t, artifacts)
})
t.Run("finds signature files", func(t *testing.T) {
dir := t.TempDir()
distDir := ax.Join(dir, "dist")