Only capture between : and the first whitespace if there is one. Also requires `/build:` instead of `build:`

This commit is contained in:
Maxime Gimeno 2020-10-15 13:09:12 +02:00
parent 84141fa302
commit 80551b1981
1 changed files with 5 additions and 1 deletions

View File

@ -18,7 +18,11 @@ jobs:
if(asso == 'OWNER' || asso == 'MEMBER') {
const body = context.payload.comment.body
if(body.includes("build:")) {
return body.replace('build:','')
const re = /\/build:(\w+)\s*/;
if(re.test(body)){
const res = re.exec(body)
return res[1];
}
}
}
return 'stop'