Handle CircleCI urls with token correctly (#2087)
This commit is contained in:
@@ -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'],
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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' })
|
||||
|
||||
Reference in New Issue
Block a user