This commit is contained in:
4
.github/workflows/update.yml
vendored
4
.github/workflows/update.yml
vendored
@@ -10,8 +10,8 @@ jobs:
|
|||||||
run: pwd && ls -ahl
|
run: pwd && ls -ahl
|
||||||
- name: 输出github环境变量
|
- name: 输出github环境变量
|
||||||
run: echo 'github相关 ${{ toJSON(github) }}'
|
run: echo 'github相关 ${{ toJSON(github) }}'
|
||||||
- name: 拷贝文件
|
# - name: 拷贝文件
|
||||||
run: task cp
|
# run: task cp
|
||||||
- name: 发送通知
|
- name: 发送通知
|
||||||
id: use-go-action
|
id: use-go-action
|
||||||
uses: https://git.aweoo.com/action/gotify@latest
|
uses: https://git.aweoo.com/action/gotify@latest
|
||||||
|
|||||||
30
main.go
30
main.go
@@ -9,8 +9,11 @@ import (
|
|||||||
"github.com/gotify/go-api-client/v2/models"
|
"github.com/gotify/go-api-client/v2/models"
|
||||||
"github.com/sethvargo/go-githubactions"
|
"github.com/sethvargo/go-githubactions"
|
||||||
"github.com/spf13/cast"
|
"github.com/spf13/cast"
|
||||||
|
"io/fs"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
"os"
|
||||||
|
"path/filepath"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -32,19 +35,20 @@ func main() {
|
|||||||
username := githubactions.GetInput("username")
|
username := githubactions.GetInput("username")
|
||||||
fmt.Printf("username is %s\n", username)
|
fmt.Printf("username is %s\n", username)
|
||||||
|
|
||||||
//dir, _ := os.Getwd()
|
dir, _ := os.Getwd()
|
||||||
//root := filepath.Join(dir, "../")
|
root := filepath.Join(dir, "../")
|
||||||
//filepath.WalkDir(root, func(path string, d fs.DirEntry, err error) error {
|
filepath.WalkDir(root, func(path string, d fs.DirEntry, err error) error {
|
||||||
// if d.IsDir() {
|
if d.IsDir() {
|
||||||
// if d.Name() == ".git" {
|
if d.Name() == ".git" {
|
||||||
// return filepath.SkipDir
|
return filepath.SkipDir
|
||||||
// }
|
}
|
||||||
// return nil
|
return nil
|
||||||
// }
|
}
|
||||||
// body, _ = os.ReadFile(path)
|
//body, _ = os.ReadFile(path)
|
||||||
// fmt.Printf("path: %s\n%s\n\n", path, string(body))
|
fmt.Printf("path: %s\n", path)
|
||||||
// return nil
|
//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"))
|
githubactions.SetOutput("time", time.Now().Format("2006-01-02 15:04:05"))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user