-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease_scripts_test.go
More file actions
39 lines (33 loc) · 937 Bytes
/
release_scripts_test.go
File metadata and controls
39 lines (33 loc) · 937 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package bbox
import (
"os"
"strings"
"testing"
)
func TestReleaseScriptsPinGoReleaserVersion(t *testing.T) {
t.Parallel()
scripts := []string{
"scripts/release-snapshot.sh",
"scripts/release-multiarch-snapshot.sh",
}
for _, path := range scripts {
path := path
t.Run(path, func(t *testing.T) {
t.Parallel()
content, err := os.ReadFile(path)
if err != nil {
t.Fatalf("read %s: %v", path, err)
}
text := string(content)
if strings.Contains(text, "github.com/goreleaser/goreleaser/v2@latest") {
t.Fatalf("%s must pin a goreleaser version instead of using @latest", path)
}
if !strings.Contains(text, `GORELEASER_VERSION:-v`) {
t.Fatalf("%s must define a pinned default GORELEASER_VERSION", path)
}
if !strings.Contains(text, `github.com/goreleaser/goreleaser/v2@"$goreleaser_version"`) {
t.Fatalf("%s must invoke the pinned goreleaser module version", path)
}
})
}
}