Skip to content

Commit

Permalink
use target commit for release SHA
Browse files Browse the repository at this point in the history
  • Loading branch information
hassansin committed Jul 13, 2018
1 parent b5e6904 commit 18aeed2
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,21 +149,18 @@ func do(editorCmd []string, token string) error {
return err
}

ed, err := newEditor(editorCmd)
if err != nil {
return err
}
ed := newEditor(editorCmd)

title, body, err := ed.edit(releaseNotes(tagName, compare.Commits))
if err != nil {
return err
}
release, err := client.createRelease(title, tagName, *compare.Commits[len(compare.Commits)-1].SHA, body)
release, err := client.createRelease(title, tagName, *target.Commit.SHA, body)
if err != nil {
return err
}

fmt.Printf("%v New release(%v) created:\n\t%v\n", green(promptui.IconGood), cyan(*release.TagName), *release.HTMLURL)
fmt.Printf("%v New release(%v) created:\n %v\n", green(promptui.IconGood), cyan(*release.TagName), *release.HTMLURL)
return nil
}

Expand Down Expand Up @@ -385,7 +382,7 @@ func mustFindEditor() []string {
return append([]string{path}, parts[1:]...)
}

func newEditor(cmd []string) (*editor, error) {
func newEditor(cmd []string) *editor {
gitDir := ".git"
if dir, ok := os.LookupEnv("GIT_DIR"); ok {
gitDir = dir
Expand All @@ -395,8 +392,7 @@ func newEditor(cmd []string) (*editor, error) {
cmd: cmd,
file: file,
mode: 0644,
}, nil

}
}

type editor struct {
Expand Down

0 comments on commit 18aeed2

Please sign in to comment.