From f9e37e6d1210b63105b013ac1556144311ca35f7 Mon Sep 17 00:00:00 2001 From: yukkodesu <17264509+yukkodesu@users.noreply.github.com> Date: Sun, 1 Jun 2025 13:48:27 +0800 Subject: [PATCH 1/2] Migration stdout setOutput to $GITHUB_OUTPUT --- main.go | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 65eae47..6c210c7 100644 --- a/main.go +++ b/main.go @@ -5,6 +5,7 @@ import ( "context" "crypto/sha256" "encoding/hex" + "fmt" "io" "net/http" "os" @@ -394,7 +395,20 @@ func generate(release *github.RepositoryRelease, output string, cnOutput string, } func setActionOutput(name string, content string) { - os.Stdout.WriteString("::set-output name=" + name + "::" + content + "\n") + outputFile := os.Getenv("GITHUB_OUTPUT") + if outputFile == "" { + fmt.Println("GITHUB_OUTPUT not set (not running in GitHub Actions?)") + return + } + f, err := os.OpenFile(outputFile, os.O_APPEND|os.O_WRONLY, 0644) + if err != nil { + panic(err) + } + defer f.Close() + if _, err := fmt.Fprintf(f, "%s=%s\n", name, content); err != nil { + panic(err) + } + fmt.Printf("setActionOutput: %s=%s\n", name, content) } func release(source string, destination string, output string, cnOutput string, ruleSetOutput string, ruleSetOutputUnstable string) error { From daa6e6117417423c48ff3779fc71e716c8fe15bd Mon Sep 17 00:00:00 2001 From: yukkodesu <17264509+yukkodesu@users.noreply.github.com> Date: Sun, 1 Jun 2025 13:49:10 +0800 Subject: [PATCH 2/2] Use *sourceRelease.TagName to set tag --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 6c210c7..f19d71c 100644 --- a/main.go +++ b/main.go @@ -430,7 +430,7 @@ func release(source string, destination string, output string, cnOutput string, if err != nil { return err } - setActionOutput("tag", *sourceRelease.Name) + setActionOutput("tag", *sourceRelease.TagName) return nil }