diff --git a/cli/pkg/release/providers/timoni.go b/cli/pkg/release/providers/timoni.go index 500abfd..c910bc4 100644 --- a/cli/pkg/release/providers/timoni.go +++ b/cli/pkg/release/providers/timoni.go @@ -3,7 +3,6 @@ package providers import ( "fmt" "log/slog" - "strings" "github.com/input-output-hk/catalyst-forge/cli/pkg/events" "github.com/input-output-hk/catalyst-forge/cli/pkg/executor" @@ -49,13 +48,9 @@ func (r *TimoniReleaser) Release() error { container = fmt.Sprintf("%s-%s", r.project.Name, "deployment") } - var tag string - if r.project.Tag != nil { - tag = strings.TrimPrefix(r.project.Tag.Version, "v") - } else if r.config.Tag != "" { - tag = r.config.Tag - } else { - return fmt.Errorf("no tag found") + tag := r.config.Tag + if tag == "" { + return fmt.Errorf("no tag specified") } for _, registry := range registries { diff --git a/cli/pkg/release/providers/timoni_test.go b/cli/pkg/release/providers/timoni_test.go index 9766c27..2060158 100644 --- a/cli/pkg/release/providers/timoni_test.go +++ b/cli/pkg/release/providers/timoni_test.go @@ -72,6 +72,33 @@ func TestTimoniReleaserRelease(t *testing.T) { assert.Contains(t, calls, "mod push --version test --latest=false . oci://test.com/test-deployment") }, }, + { + name: "not firing", + project: newProject("test", []string{"test.com"}), + firing: false, + force: false, + failOn: "", + validate: func(t *testing.T, calls []string, err error) { + require.NoError(t, err) + assert.Len(t, calls, 0) + }, + }, + { + name: "forced", + project: newProject("test", []string{"test.com"}), + release: schema.Release{}, + config: TimoniReleaserConfig{ + Container: "test", + Tag: "test", + }, + firing: false, + force: true, + failOn: "", + validate: func(t *testing.T, calls []string, err error) { + require.NoError(t, err) + assert.Contains(t, calls, "mod push --version test --latest=false . oci://test.com/test") + }, + }, { name: "push fails", project: newProject("test", []string{"test.com"}),