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
This commit is contained in:
Adam Williams 2017-05-22 08:44:49 -06:00 committed by Adam Williams
parent 923189eb1a
commit b32e6172f5
1 changed files with 1 additions and 1 deletions

View File

@ -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,