From 35f2f9380d77ac7d0b9967986f5866c4d79cbfd2 Mon Sep 17 00:00:00 2001 From: Will Date: Tue, 29 Aug 2023 10:46:48 +0900 Subject: [PATCH] write output to environment file --- main.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 0fee407..24a9969 100644 --- a/main.go +++ b/main.go @@ -121,7 +121,16 @@ func build(args *Args, fs vfs.FS) error { } if GithubAction { - fmt.Printf("::set-output name=package::%s\n", info.Target) + path := os.Getenv("GITHUB_OUTPUT") + mode := os.O_APPEND | os.O_WRONLY + + file, err := os.OpenFile(path, mode, 0) + if err != nil { + return err + } + defer file.Close() + + fmt.Fprintf(file, "package=%s\n", info.Target) } }