mirror of
https://github.com/SagerNet/sing-geosite.git
synced 2026-06-17 15:31:02 +08:00
Merge daa6e61174 into dd64ae0ebf
This commit is contained in:
commit
48093565ad
18
main.go
18
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 {
|
||||
@ -416,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
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user