Skip to content

Commit

Permalink
Showing 4 changed files with 4 additions and 28 deletions.
13 changes: 1 addition & 12 deletions lib/api-client.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/api-client.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 1 addition & 14 deletions src/api-client.ts
@@ -11,7 +11,7 @@ export const getApiClient = function(githubAuth: string, githubUrl: string, allo
}
return new github.GitHub(
{
auth: parseAuth(githubAuth),
auth: githubAuth,
baseUrl: getApiUrl(githubUrl),
userAgent: "CodeQL Action",
log: consoleLogLevel({ level: "debug" })
@@ -32,19 +32,6 @@ function getApiUrl(githubUrl: string): string {
return url.toString();
}

// Parses the user input as either a single token,
// or a username and password / PAT.
function parseAuth(auth: string): string {
// Check if it's a username:password pair
const c = auth.indexOf(':');
if (c !== -1) {
return 'basic ' + Buffer.from(auth).toString('base64');
}

// Otherwise use the token as it is
return auth;
}

// Temporary function to aid in the transition to running on and off of github actions.
// Once all code has been coverted this function should be removed or made canonical
// and called only from the action entrypoints.
2 changes: 1 addition & 1 deletion src/runner.ts
@@ -84,7 +84,7 @@ program
.description('Initializes CodeQL')
.requiredOption('--repository <repository>', 'Repository name')
.requiredOption('--github-url <url>', 'URL of GitHub instance')
.requiredOption('--github-auth <auth>', 'GitHub Apps token, or of the form "username:token" if using a personal access token')
.requiredOption('--github-auth <auth>', 'GitHub Apps token or personal access token')
.option('--languages <languages>', 'Comma-separated list of languages to analyze. Defaults to trying to detect languages from the repo.')
.option('--queries <queries>', 'Comma-separated list of additional queries to run. By default, this overrides the same setting in a configuration file.')
.option('--config-file <file>', 'Path to config file')

0 comments on commit 3dfaa88

Please sign in to comment.