Fix tag name
This commit is contained in:
parent
23a38ad334
commit
f7b296697e
1 changed files with 3 additions and 2 deletions
5
main.go
5
main.go
|
@ -29,8 +29,9 @@ func main() {
|
||||||
apiKey := gha.GetInput("api_key")
|
apiKey := gha.GetInput("api_key")
|
||||||
preRelease, _ := strconv.ParseBool(gha.GetInput("pre_release"))
|
preRelease, _ := strconv.ParseBool(gha.GetInput("pre_release"))
|
||||||
draft, _ := strconv.ParseBool(gha.GetInput("draft"))
|
draft, _ := strconv.ParseBool(gha.GetInput("draft"))
|
||||||
|
tagName := strings.Replace(ctx.RefName, "refs/tags/", "", 1)
|
||||||
if title == "" {
|
if title == "" {
|
||||||
title = ctx.RefName
|
title = tagName
|
||||||
}
|
}
|
||||||
if apiKey == "" {
|
if apiKey == "" {
|
||||||
apiKey = os.Getenv("GITHUB_TOKEN")
|
apiKey = os.Getenv("GITHUB_TOKEN")
|
||||||
|
@ -54,7 +55,7 @@ func main() {
|
||||||
repo := strings.Split(ctx.Repository, "/")[1]
|
repo := strings.Split(ctx.Repository, "/")[1]
|
||||||
|
|
||||||
rel, err := createOrGetRelease(ctx, c, owner, repo, gitea.CreateReleaseOption{
|
rel, err := createOrGetRelease(ctx, c, owner, repo, gitea.CreateReleaseOption{
|
||||||
TagName: ctx.RefName,
|
TagName: tagName,
|
||||||
IsDraft: draft,
|
IsDraft: draft,
|
||||||
IsPrerelease: preRelease,
|
IsPrerelease: preRelease,
|
||||||
Title: title,
|
Title: title,
|
||||||
|
|
Reference in a new issue