From b32e6172f50dbab3ca4709d65378c3c5098f7731 Mon Sep 17 00:00:00 2001 From: Adam Williams Date: Mon, 22 May 2017 08:44:49 -0600 Subject: [PATCH] Fix extraction of tag name from commit ref to handle `/` Previously, tags with a `/` character were not correctly handled because `filepath.Base` was used. This would return the last element of path. This change allows for tags like `test/v1.2.3` to work properly by trimming the `refs/tags/` prefix from the commit ref. Issue #24 --- plugin.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin.go b/plugin.go index 615f1cb..f9a3ac5 100644 --- a/plugin.go +++ b/plugin.go @@ -116,7 +116,7 @@ func (p Plugin) Exec() error { Client: client, Owner: p.Repo.Owner, Repo: p.Repo.Name, - Tag: filepath.Base(p.Commit.Ref), + Tag: strings.TrimPrefix(p.Commit.Ref, "refs/tags/"), Draft: p.Config.Draft, Prerelease: p.Config.Prerelease, FileExists: p.Config.FileExists,