releaser: Add a way to bust the CircleCI Git cache

This commit is contained in:
Bjørn Erik Pedersen
2023-05-29 09:25:09 +02:00
parent e3dfc76fa8
commit 9e05fbaad4

View File

@@ -46,6 +46,12 @@ func New(skipPush, try bool, step int) (*ReleaseHandler, error) {
return nil, fmt.Errorf("branch %q is not a release branch", branch) return nil, fmt.Errorf("branch %q is not a release branch", branch)
} }
// Trim any cache busting suffix, e.g "release-0.90.0-take2"
takeIdx := strings.Index(branch, "-take")
if takeIdx > 0 {
branch = branch[:takeIdx]
}
version := strings.TrimPrefix(branch, prefix) version := strings.TrimPrefix(branch, prefix)
version = strings.TrimPrefix(version, "v") version = strings.TrimPrefix(version, "v")