From f0179fed9a5f11f0f40c4aa2dc3c771bbaafdd6c Mon Sep 17 00:00:00 2001 From: fghwett <1058178245@qq.com> Date: Thu, 21 Dec 2023 11:35:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=95=E7=94=A8=E7=AC=AC=E4=B8=89=E6=96=B9?= =?UTF-8?q?=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- go.mod | 5 +++++ main.go | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/go.mod b/go.mod index c63dd3e..e975119 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,8 @@ module simple-go-action go 1.21.1 + +require ( + github.com/sethvargo/go-envconfig v0.8.0 // indirect + github.com/sethvargo/go-githubactions v1.1.0 // indirect +) diff --git a/main.go b/main.go index 5d1e78f..3a26df3 100644 --- a/main.go +++ b/main.go @@ -4,9 +4,18 @@ import ( "fmt" "os" "time" + + gha "github.com/sethvargo/go-githubactions" ) func main() { + username := gha.GetInput("username") + fmt.Printf("username is %s\n", username) + + gha.SetOutput("time", time.Now().Format("2006-01-02 15:04:05")) +} + +func old_version() { username := readInputs() fmt.Printf("username is %s\n", username)