Skip to content

Commit

Permalink
Skipping resolveTagToCommitSHA for drafts
Browse files Browse the repository at this point in the history
  • Loading branch information
Anton Ustyuzhanin committed Apr 18, 2018
1 parent 8bc116b commit e420eea
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions in_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,19 @@ func (c *InCommand) Run(destDir string, request InRequest) (InResponse, error) {
return InResponse{}, err
}

commitPath := filepath.Join(destDir, "commit_sha")
commitSHA, err = c.resolveTagToCommitSHA(*foundRelease.TagName)
if err != nil {
return InResponse{}, err
}

if commitSHA != "" {
err = ioutil.WriteFile(commitPath, []byte(commitSHA), 0644)
if !request.Source.Drafts {
commitPath := filepath.Join(destDir, "commit_sha")
commitSHA, err = c.resolveTagToCommitSHA(*foundRelease.TagName)
if err != nil {
return InResponse{}, err
}

if commitSHA != "" {
err = ioutil.WriteFile(commitPath, []byte(commitSHA), 0644)
if err != nil {
return InResponse{}, err
}
}
}

if foundRelease.Body != nil && *foundRelease.Body != "" {
Expand Down

0 comments on commit e420eea

Please sign in to comment.