Skip to content

Commit 2f078ed

Browse files
authored
fix(cli): removes 'v' prefix in Timoni tags (#100)
1 parent a47a738 commit 2f078ed

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

cli/pkg/release/providers/timoni.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package providers
33
import (
44
"fmt"
55
"log/slog"
6+
"strings"
67

78
"github.com/input-output-hk/catalyst-forge/cli/pkg/events"
89
"github.com/input-output-hk/catalyst-forge/cli/pkg/executor"
@@ -48,7 +49,7 @@ func (r *TimoniReleaser) Release() error {
4849
container = fmt.Sprintf("%s-%s", r.project.Name, "deployment")
4950
}
5051

51-
tag := r.config.Tag
52+
tag := strings.TrimPrefix(r.config.Tag, "v")
5253
if tag == "" {
5354
return fmt.Errorf("no tag specified")
5455
}

cli/pkg/release/providers/timoni_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,22 @@ func TestTimoniReleaserRelease(t *testing.T) {
5757
assert.Contains(t, calls, "mod push --version test --latest=false . oci://test.com/test")
5858
},
5959
},
60+
{
61+
name: "with v prefix",
62+
project: newProject("test", []string{"test.com"}),
63+
release: schema.Release{},
64+
config: TimoniReleaserConfig{
65+
Container: "test",
66+
Tag: "v1.0.0",
67+
},
68+
firing: true,
69+
force: false,
70+
failOn: "",
71+
validate: func(t *testing.T, calls []string, err error) {
72+
require.NoError(t, err)
73+
assert.Contains(t, calls, "mod push --version 1.0.0 --latest=false . oci://test.com/test")
74+
},
75+
},
6076
{
6177
name: "no container",
6278
project: newProject("test", []string{"test.com"}),

0 commit comments

Comments
 (0)