Skip to content

Commit

Permalink
mageutils:bugfix - use name instead of tag name and push release bran…
Browse files Browse the repository at this point in the history
…ch (#137)

Signed-off-by: Nathan Martins <nathan.martins@zup.com.br>
  • Loading branch information
nathanmartinszup authored Nov 26, 2021
1 parent 7a39e9a commit 44f0135
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion pkg/utils/mageutils/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ func CheckoutReleaseBranch(branchName string) error {
if err := sh.RunV("git", "checkout", branchName); err != nil {
log.Printf("First %s release, creating release branch", branchName)

return sh.RunV("git", "checkout", "-b", branchName)
if err := sh.RunV("git", "checkout", "-b", branchName); err != nil {
return err
}

return sh.RunV("git", "push", "--set-upstream", "origin", branchName)
}

return nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/utils/mageutils/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func (u *upVersions) getLatestRelease() error {
return err
}

u.actualReleaseVersion = *release.TagName
u.actualReleaseVersion = release.GetName()

return nil
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/utils/mageutils/version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func toStringPointer(value string) *string {
}

func newMockRelease(tagName string) *github.RepositoryRelease {
return &github.RepositoryRelease{TagName: toStringPointer(tagName)}
return &github.RepositoryRelease{Name: toStringPointer(tagName)}
}

func newMockTags(tags []string) []*github.RepositoryTag {
Expand Down

0 comments on commit 44f0135

Please sign in to comment.