File tree 3 files changed +8
-8
lines changed
3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -15,8 +15,8 @@ exports.handler = async (opts) => {
15
15
opts . native = true ;
16
16
}
17
17
18
- const { file, repo , native , asset : path } = opts ;
19
- const cml = new CML ( { ...opts , repo : native ? repo : 'cml' } ) ;
18
+ const { file, asset : path } = opts ;
19
+ const cml = new CML ( { ...opts } ) ;
20
20
const output = await cml . publish ( { ...opts , path } ) ;
21
21
22
22
if ( ! file ) console . log ( output ) ;
Original file line number Diff line number Diff line change @@ -69,9 +69,10 @@ const inferToken = () => {
69
69
const inferDriver = ( opts = { } ) => {
70
70
const { repo } = opts ;
71
71
if ( repo ) {
72
- if ( repo . includes ( 'github.com' ) ) return GITHUB ;
73
- if ( repo . includes ( 'gitlab.com' ) ) return GITLAB ;
74
- if ( / b i t b u c k e t \. ( c o m | o r g ) / . test ( repo ) ) return BB ;
72
+ const url = new URL ( repo ) ;
73
+ if ( url . hostname === 'github.com' ) return GITHUB ;
74
+ if ( url . hostname === 'gitlab.com' ) return GITLAB ;
75
+ if ( / b i t b u c k e t \. ( c o m | o r g ) / . test ( url . hostname ) ) return BB ;
75
76
}
76
77
77
78
if ( GITHUB_REPOSITORY ) return GITHUB ;
Original file line number Diff line number Diff line change @@ -66,11 +66,10 @@ const octokit = (token, repo) => {
66
66
onAbuseLimit : throttleHandler
67
67
}
68
68
} ;
69
-
70
- if ( ! repo . includes ( 'github.com' ) ) {
69
+ const { host , hostname } = new url . URL ( repo ) ;
70
+ if ( hostname !== 'github.com' ) {
71
71
// GitHub Enterprise, use the: repo URL host + '/api/v3' - as baseURL
72
72
// as per: https://developer.github.com/enterprise/v3/enterprise-admin/#endpoint-urls
73
- const { host } = new url . URL ( repo ) ;
74
73
octokitOptions . baseUrl = `https://${ host } /api/v3` ;
75
74
}
76
75
You can’t perform that action at this time.
0 commit comments