Making commit-ish optional

This commit is contained in:
Eamonn Nugent
2019-04-04 00:55:01 -04:00
committed by GitHub
parent ab8d9ba33a
commit 1d9c9b45ae

View File

@@ -36,11 +36,6 @@ func (c *OutCommand) Run(sourceDir string, request OutRequest) (OutResponse, err
tag_name = request.Params.TagPrefix + tag_name
targetCommitish, err := c.fileContents(filepath.Join(sourceDir, request.Params.CommitishPath))
if err != nil {
return OutResponse{}, err
}
// if request.Params.BodyPath != "" {
// _, err := c.fileContents(filepath.Join(sourceDir, request.Params.BodyPath))
// if err != nil {
@@ -57,6 +52,10 @@ func (c *OutCommand) Run(sourceDir string, request OutRequest) (OutResponse, err
// create the tag first, as next sections assume the tag exists
if !tagExists {
targetCommitish, err := c.fileContents(filepath.Join(sourceDir, request.Params.CommitishPath))
if err != nil {
return OutResponse{}, err
}
tag, err = c.gitlab.CreateTag(targetCommitish, tag_name)
if err != nil {
return OutResponse{}, err