From bc850d3f99df0e917850177625a3d2bba9f342c3 Mon Sep 17 00:00:00 2001 From: yanmi <38313933+jimbirthday@users.noreply.github.com> Date: Mon, 23 Nov 2020 09:52:45 +0800 Subject: [PATCH 1/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b4a7c52..13714e9 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@

-# Goinks: *More Power* +# Gokins: *More Power* 构建赋能,更加强大 [![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html) -- Gitee From b8650ef00f50e2c17c7ab8afdeb85a55d6287291 Mon Sep 17 00:00:00 2001 From: UchihaRuis Date: Wed, 20 Jan 2021 15:25:18 +0800 Subject: [PATCH 2/5] update README.md. --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index 13714e9..4fad841 100644 --- a/README.md +++ b/README.md @@ -251,6 +251,3 @@ Gokins目前还处于需要不断进步的阶段,如果你有兴趣假如我 2. 环境变量PATH优化,加入变量获取 - - - -- Gitee From 6fb0358258edecfcaf32896477ae450bcdada4c3 Mon Sep 17 00:00:00 2001 From: angular <1921934563@qq.com> Date: Fri, 18 Jun 2021 18:55:10 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AF=B9=E9=98=BF?= =?UTF-8?q?=E9=87=8C=E4=BA=91=E7=9A=84codeup=E6=8F=92=E4=BB=B6=E7=9A=84?= =?UTF-8?q?=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mgr/trigger_hooks.go | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/mgr/trigger_hooks.go b/mgr/trigger_hooks.go index 6aea687..8e653e6 100644 --- a/mgr/trigger_hooks.go +++ b/mgr/trigger_hooks.go @@ -86,6 +86,37 @@ function main(){ ret.check=true; return ret } +`, + } + // 添加对阿里云的codeup的支持! + HookjsMap["codeup"] = &Hookjs{ + Uis: map[string]string{"token": "string", "branch": "string"}, + Desc: "secret:秘钥,branch:push对象分支", + Defs: `{"secret":"pwd","branch":"master"}`, + js: ` + +function main(){ + console.log('start run main function!!!!'); + var ret={check:false}; + var conf=getConf(); + var body=getBody(); + var event=getHeader('X-Codeup-Token '); + if(conf.secret!=body.secret){ + ret.errs='触发请求秘钥错误'; + return ret; + } + + if(event!='push'||!body.ref||body.ref==''){ + return ret; + } + + console.log(conf.branch,body.ref); + if(conf.branch&&conf.branch!=''&&body.ref!='refs/heads/'+conf.branch){ + return ret; + } + ret.check=true; + return ret +} `, } HookjsMap["github"] = &Hookjs{ -- Gitee From 72303d17593505abb457765d4b0c202c92baefba Mon Sep 17 00:00:00 2001 From: angular <1921934563@qq.com> Date: Fri, 18 Jun 2021 19:25:16 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E5=8F=82=E6=95=B0token?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mgr/trigger_hooks.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mgr/trigger_hooks.go b/mgr/trigger_hooks.go index 8e653e6..e9b4289 100644 --- a/mgr/trigger_hooks.go +++ b/mgr/trigger_hooks.go @@ -92,7 +92,7 @@ function main(){ HookjsMap["codeup"] = &Hookjs{ Uis: map[string]string{"token": "string", "branch": "string"}, Desc: "secret:秘钥,branch:push对象分支", - Defs: `{"secret":"pwd","branch":"master"}`, + Defs: `{"token":"pwd","branch":"master"}`, js: ` function main(){ -- Gitee From 15957ad79d391a8088ad74f7e0a395906eec06e2 Mon Sep 17 00:00:00 2001 From: jim <303600370@qq.com> Date: Sat, 19 Jun 2021 14:59:48 +0800 Subject: [PATCH 5/5] fix:bug codeup --- mgr/trigger_hooks.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mgr/trigger_hooks.go b/mgr/trigger_hooks.go index e9b4289..e682cb0 100644 --- a/mgr/trigger_hooks.go +++ b/mgr/trigger_hooks.go @@ -100,13 +100,14 @@ function main(){ var ret={check:false}; var conf=getConf(); var body=getBody(); - var event=getHeader('X-Codeup-Token '); + var secret=getHeader('X-Codeup-Token'); + var event=getHeader('X-Codeup-Event'); if(conf.secret!=body.secret){ ret.errs='触发请求秘钥错误'; return ret; } - if(event!='push'||!body.ref||body.ref==''){ + if(event!='Push Hook'||!body.ref||body.ref==''){ return ret; } -- Gitee