- 复制bin/test.sh为master.ref.sh (请尽量以.ref.sh结尾)
case $1 in
"refs/heads/master") # 可根据不同的分支做不同的任务
echo $1
;;
esac
- 安装go环境(以及go mod)
- 执行依耐安装(go mod tidy)
# https://github.com/cosmtrek/air
curl -sSfL https://raw.githubusercontent.com/cosmtrek/air/master/install.sh | sh -s -- -b $(go env GOPATH)/bin
// 模块运行
go test -v test/shell_test.go
// 方法运行
go test -v -run TestShell test/shell_test.go
go build -o build/wh-mac main.go
GOOS=linux GOARCH=amd64 go build -o build/wh-linux main.go
启动webhooks服务 (端口号默认为8080)
# 调试模式
./webhook server start
# daemon模式
./webhook server start -d
# post
https://domain/webhooks
# token 为bin目录下文件名${token}.ref.sh中${token}部分