File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ const yaml = require('js-yaml')
55const schema = require ( './schema' ) . schema
66
77const GITHUB_CREDENTIALS = ( process . env . CLIENT_ID && process . env . CLIENT_SECRET )
8- ? `client_id= ${ process . env . CLIENT_ID } &client_secret= ${ process . env . CLIENT_SECRET } `
8+ ? `${ process . env . CLIENT_ID } : ${ process . env . CLIENT_SECRET } @ `
99 : ''
1010const getJSON = uri => requestPromise ( {
1111 uri,
@@ -135,14 +135,14 @@ module.exports = app => {
135135 routes . get ( '/check/:owner/:repo' , ( req , res ) => {
136136 const fullName = `${ req . params . owner } /${ req . params . repo } `
137137 app . log . info ( `[${ fullName } ] Checking ${ app . CONFIG_FILENAME } ` )
138- getJSON ( `https://api.github.com/repos/${ fullName } /contents/.github/${ app . CONFIG_FILENAME } ? ${ GITHUB_CREDENTIALS } ` )
138+ getJSON ( `https://${ GITHUB_CREDENTIALS } api.github.com/repos/${ fullName } /contents/.github/${ app . CONFIG_FILENAME } ` )
139139 . then ( json => Buffer . from ( json . content , 'base64' ) . toString ( ) )
140140 . then ( yml => yaml . safeLoad ( yml ) )
141141 . then ( ( config ) => {
142142 const { error, value } = schema . validate ( config )
143143 if ( error ) throw error
144144 const reqs = value . rules . map ( r => new Promise ( ( resolve , reject ) => {
145- getJSON ( `https://api.github.com/repos/${ fullName } /compare/${ r . base } ...${ r . upstream } ? ${ GITHUB_CREDENTIALS } ` )
145+ getJSON ( `https://${ GITHUB_CREDENTIALS } api.github.com/repos/${ fullName } /compare/${ r . base } ...${ r . upstream } ` )
146146 . then ( githubRes => resolve ( ) )
147147 . catch ( e => reject ( e ) )
148148 } ) )
You can’t perform that action at this time.
0 commit comments