Handle CircleCI urls with token correctly (#2087)

This commit is contained in:
Eugene Zhlobo
2018-09-18 11:03:00 +03:00
committed by chris48s
parent 6d49c762b9
commit c8593c77c4
2 changed files with 12 additions and 1 deletions

View File

@@ -57,7 +57,7 @@ module.exports = class CircleCi extends BaseJsonService {
return {
base: 'circleci',
format:
'(?:token/(w+))?[+/]?project/(?:(github|bitbucket)/)?([^/]+/[^/]+)(?:/(.*))?',
'(?:token/(\\w+)/)?project/(?:(github|bitbucket)/)?([^/]+/[^/]+)(?:/(.*))?',
capture: ['token', 'vcsType', 'userRepo', 'branch'],
}
}

View File

@@ -25,6 +25,17 @@ t.create('circle ci (valid, with branch)')
})
)
t.create('circle ci (valid, with token)')
.get(
'/token/b90b5c49e59a4c67ba3a92f7992587ac7a0408c2/project/github/RedSparr0w/node-csgo-parser/master.json'
)
.expectJSONTypes(
Joi.object().keys({
name: 'build',
value: isBuildStatus,
})
)
t.create('circle ci (not found)')
.get('/project/github/PyvesB/EmptyRepo.json')
.expectJSON({ name: 'build', value: 'project not found' })