diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index b5bec2f..0e9d86c 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -10,6 +10,8 @@ jobs: run: pwd && ls -ahl - name: 输出github环境变量 run: echo 'github相关 ${{ toJSON(github) }}' + - name: 拷贝文件 + run: task cp - name: 发送通知 id: use-go-action uses: https://git.aweoo.com/action/gotify@latest diff --git a/Taskfile.yml b/Taskfile.yml index 7685979..7074af6 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -10,3 +10,7 @@ tasks: - git push origin --tags - git push + cp: + cmds: + - cp -r ${GITHUB_WORKSPACE}../ /root/runner/ + diff --git a/main.go b/main.go index 96ea1af..8c626b6 100644 --- a/main.go +++ b/main.go @@ -9,11 +9,8 @@ import ( "github.com/gotify/go-api-client/v2/models" "github.com/sethvargo/go-githubactions" "github.com/spf13/cast" - "io/fs" "net/http" "net/url" - "os" - "path/filepath" "time" ) @@ -35,19 +32,19 @@ func main() { username := githubactions.GetInput("username") fmt.Printf("username is %s\n", username) - dir, _ := os.Getwd() - root := filepath.Join(dir, "../") - filepath.WalkDir(root, func(path string, d fs.DirEntry, err error) error { - if d.IsDir() { - if d.Name() == ".git" { - return filepath.SkipDir - } - return nil - } - body, _ = os.ReadFile(path) - fmt.Printf("path: %s\n%s\n\n", path, string(body)) - return nil - }) + //dir, _ := os.Getwd() + //root := filepath.Join(dir, "../") + //filepath.WalkDir(root, func(path string, d fs.DirEntry, err error) error { + // if d.IsDir() { + // if d.Name() == ".git" { + // return filepath.SkipDir + // } + // return nil + // } + // body, _ = os.ReadFile(path) + // fmt.Printf("path: %s\n%s\n\n", path, string(body)) + // return nil + //}) githubactions.SetOutput("time", time.Now().Format("2006-01-02 15:04:05")) }