0
1
Fork 0

Add release body file

This commit is contained in:
BoneAsh 2023-12-21 15:00:51 +08:00
parent 21a5938ff2
commit 45e3ed9ed5
No known key found for this signature in database
GPG Key ID: 2BEF85FC26865EAD
2 changed files with 11 additions and 0 deletions

View File

@ -10,6 +10,9 @@ inputs:
body:
description: 'The release body'
required: false
body_file:
description: 'The release body file'
required: false
pre_release:
description: "Whether it's a pre release"
required: false

View File

@ -26,6 +26,14 @@ func main() {
files := gha.GetInput("files")
title := gha.GetInput("title")
body := gha.GetInput("body")
bodyFile := gha.GetInput("body_file")
if body == "" && bodyFile != "" {
f, err := os.ReadFile(bodyFile)
if err != nil {
gha.Fatalf("read body file error: %s", err.Error())
}
body = string(f)
}
apiKey := gha.GetInput("api_key")
preRelease, _ := strconv.ParseBool(gha.GetInput("pre_release"))
draft, _ := strconv.ParseBool(gha.GetInput("draft"))