first version
Some checks failed
代码更新通知 / update-server (push) Failing after 0s

This commit is contained in:
2024-12-18 11:23:01 +08:00
commit ea9148395c
9 changed files with 87 additions and 0 deletions

27
main.go Normal file
View File

@@ -0,0 +1,27 @@
package main
import (
"encoding/json"
"fmt"
"github.com/sethvargo/go-githubactions"
"time"
)
func main() {
ctx, err := githubactions.Context()
if err != nil {
panic(err)
}
body, err := json.Marshal(ctx)
if err != nil {
panic(err)
}
fmt.Printf("context: %s\n", string(body))
username := githubactions.GetInput("username")
fmt.Printf("username is %s\n", username)
githubactions.SetOutput("time", time.Now().Format("2006-01-02 15:04:05"))
}