diff --git a/in_command.go b/in_command.go index b1bf35f..da272b8 100644 --- a/in_command.go +++ b/in_command.go @@ -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 != "" {