0
0
mirror of https://github.com/thegeeklab/wp-gitea-release.git synced 2024-11-22 10:10:40 +00:00

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

View File

@ -116,7 +116,7 @@ func (p Plugin) Exec() error {
Client: client, Client: client,
Owner: p.Repo.Owner, Owner: p.Repo.Owner,
Repo: p.Repo.Name, Repo: p.Repo.Name,
Tag: filepath.Base(p.Commit.Ref), Tag: strings.TrimPrefix(p.Commit.Ref, "refs/tags/"),
Draft: p.Config.Draft, Draft: p.Config.Draft,
Prerelease: p.Config.Prerelease, Prerelease: p.Config.Prerelease,
FileExists: p.Config.FileExists, FileExists: p.Config.FileExists,