From e420eea591dc4ec910effc2c373dbcc74d2d7e71 Mon Sep 17 00:00:00 2001 From: Anton Ustyuzhanin Date: Wed, 18 Apr 2018 22:15:46 +0200 Subject: [PATCH] Skipping resolveTagToCommitSHA for drafts --- in_command.go | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) 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 != "" {