Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding error handling to tag version creation #1470

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions pkg/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"strings"

"github.com/hashicorp/go-version"
yaml "gopkg.in/yaml.v2"
"gopkg.in/yaml.v2"

"github.com/dapr/cli/pkg/print"
"github.com/dapr/cli/utils"
Expand Down Expand Up @@ -120,7 +120,11 @@ func GetLatestReleaseGithub(githubURL string) (string, error) {

for _, release := range githubRepoReleases {
if !strings.Contains(release.TagName, "-rc") {
cur, _ := version.NewVersion(strings.TrimPrefix(release.TagName, "v"))
cur, curErr := version.NewVersion(strings.TrimPrefix(release.TagName, "v"))
if curErr != nil {
print.WarningStatusEvent(os.Stdout, "Failed to parse version: '%s'", curErr)
continue
}
if cur.GreaterThan(latestVersion) {
latestVersion = cur
}
Expand Down