Use correct release tag
This commit is contained in:
parent
4d04a5e239
commit
dbd40bc8e6
9
main.go
9
main.go
@ -28,8 +28,11 @@ 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 = strings.Replace(ctx.RefName, "refs/tags/", "", 1)
|
||||
title = tagName
|
||||
}
|
||||
if apiKey == "" {
|
||||
apiKey = os.Getenv("GITHUB_TOKEN")
|
||||
@ -53,7 +56,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,
|
||||
@ -150,7 +153,7 @@ func createOrGetRelease(ctx *gha.GitHubContext, c *gitea.Client, owner, repo str
|
||||
|
||||
func getFilename(ctx *gha.GitHubContext, path string) string {
|
||||
fileKey := gha.GetInput("file_key")
|
||||
fileName := filepath.Base(path)
|
||||
fileName := filepath.Base(path)
|
||||
ext := filepath.Ext(fileName)
|
||||
filePath := strings.TrimSuffix(fileName, ext)
|
||||
return filePath + fileKey + ext
|
||||
|
Loading…
x
Reference in New Issue
Block a user