Skip to content

Commit

Permalink
fix(cli): removes 'v' prefix in Timoni tags (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmgilman authored Nov 27, 2024
1 parent a47a738 commit 2f078ed
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cli/pkg/release/providers/timoni.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ 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"
Expand Down Expand Up @@ -48,7 +49,7 @@ func (r *TimoniReleaser) Release() error {
container = fmt.Sprintf("%s-%s", r.project.Name, "deployment")
}

tag := r.config.Tag
tag := strings.TrimPrefix(r.config.Tag, "v")
if tag == "" {
return fmt.Errorf("no tag specified")
}
Expand Down
16 changes: 16 additions & 0 deletions cli/pkg/release/providers/timoni_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,22 @@ func TestTimoniReleaserRelease(t *testing.T) {
assert.Contains(t, calls, "mod push --version test --latest=false . oci://test.com/test")
},
},
{
name: "with v prefix",
project: newProject("test", []string{"test.com"}),
release: schema.Release{},
config: TimoniReleaserConfig{
Container: "test",
Tag: "v1.0.0",
},
firing: true,
force: false,
failOn: "",
validate: func(t *testing.T, calls []string, err error) {
require.NoError(t, err)
assert.Contains(t, calls, "mod push --version 1.0.0 --latest=false . oci://test.com/test")
},
},
{
name: "no container",
project: newProject("test", []string{"test.com"}),
Expand Down

0 comments on commit 2f078ed

Please sign in to comment.