mirror of
https://gitee.com/gokins/gokins.git
synced 2024-11-29 17:57:50 +08:00
添加对阿里云的codeup插件的支持
This commit is contained in:
parent
b8650ef00f
commit
6fb0358258
@ -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{
|
||||
|
Loading…
Reference in New Issue
Block a user