From f7b296697e45a1711545f6bae163b9188b613184 Mon Sep 17 00:00:00 2001 From: Evan Date: Mon, 16 Oct 2023 21:06:51 -0400 Subject: [PATCH] Fix tag name --- main.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index e2acaaa..c6c605d 100644 --- a/main.go +++ b/main.go @@ -29,8 +29,9 @@ func main() { apiKey := gha.GetInput("api_key") preRelease, _ := strconv.ParseBool(gha.GetInput("pre_release")) draft, _ := strconv.ParseBool(gha.GetInput("draft")) + tagName := strings.Replace(ctx.RefName, "refs/tags/", "", 1) if title == "" { - title = ctx.RefName + title = tagName } if apiKey == "" { apiKey = os.Getenv("GITHUB_TOKEN") @@ -54,7 +55,7 @@ func main() { repo := strings.Split(ctx.Repository, "/")[1] rel, err := createOrGetRelease(ctx, c, owner, repo, gitea.CreateReleaseOption{ - TagName: ctx.RefName, + TagName: tagName, IsDraft: draft, IsPrerelease: preRelease, Title: title,