From 3edd4ed38489945e5901687e5ab93d758ee1eaef Mon Sep 17 00:00:00 2001 From: Desmond Kyeremeh Date: Mon, 22 Jan 2024 23:08:48 +0000 Subject: [PATCH] Update plugin to allow for other events on tags --- plugin.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugin.go b/plugin.go index 2a31c33..62a8b7d 100644 --- a/plugin.go +++ b/plugin.go @@ -50,9 +50,10 @@ type ( func (p Plugin) Exec() error { var ( files []string + tag = strings.TrimPrefix(p.Commit.Ref, "refs/tags/") ) - if p.Build.Event != "tag" { + if tag == "" { return fmt.Errorf("The Gitea Release plugin is only available for tags") } @@ -128,7 +129,7 @@ func (p Plugin) Exec() error { Client: client, Owner: p.Repo.Owner, Repo: p.Repo.Name, - Tag: strings.TrimPrefix(p.Commit.Ref, "refs/tags/"), + Tag: tag, Draft: p.Config.Draft, Prerelease: p.Config.PreRelease, FileExists: p.Config.FileExists,