remove unused arguments

This commit is contained in:
Robert Brignull 2020-08-11 13:56:23 +01:00
parent 34b372292b
commit cf08f5a9cd
8 changed files with 11 additions and 30 deletions

View file

@ -24,11 +24,6 @@ function parseAuth(auth: string): string {
const c = auth.indexOf(':');
if (c !== -1) {
return 'basic ' + Buffer.from(auth).toString('base64');
// return {
// username: auth.substring(0, c),
// password: auth.substring(c + 1),
// on2fa: async () => { throw new Error(''); }
// };
}
// Otherwise use the token as it is

View file

@ -13,12 +13,9 @@ interface UploadArgs {
repository: string;
commit: string;
ref: string;
analysisKey: string;
githubUrl: string;
githubAuth: string;
analysisName: string | undefined;
checkoutPath: string | undefined;
environment: string | undefined;
}
function parseGithubApiUrl(inputUrl: string): string {
@ -50,12 +47,9 @@ program
.requiredOption('--repository <repository>', 'Repository name')
.requiredOption('--commit <commit>', 'SHA of commit that was analyzed')
.requiredOption('--ref <ref>', 'Name of ref that was analyzed')
.requiredOption('--analysis-key <key>', 'Identifies the analysis, for use matching up equivalent analyses on different commits')
.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')
.option('--checkout-path <path>', 'Checkout path (default: current working directory)')
.option('--analysis-name <name>', 'Display name of the analysis (default: same as analysis-key')
.option('--environment <env>', 'Environment (default: empty)')
.action(async (cmd: UploadArgs) => {
const logger = getCLILogger();
try {
@ -64,11 +58,11 @@ program
parseRepositoryNwo(cmd.repository),
cmd.commit,
cmd.ref,
cmd.analysisKey,
cmd.analysisName || cmd.analysisKey,
undefined,
undefined,
undefined,
cmd.checkoutPath || process.cwd(),
cmd.environment,
undefined,
cmd.githubAuth,
parseGithubApiUrl(cmd.githubUrl),
'cli',

View file

@ -126,8 +126,8 @@ export async function upload(
repositoryNwo: RepositoryNwo,
commitOid: string,
ref: string,
analysisKey: string,
analysisName: string,
analysisKey: string | undefined,
analysisName: string | undefined,
workflowRunID: number | undefined,
checkoutPath: string,
environment: string | undefined,
@ -203,8 +203,8 @@ async function uploadFiles(
repositoryNwo: RepositoryNwo,
commitOid: string,
ref: string,
analysisKey: string,
analysisName: string,
analysisKey: string | undefined,
analysisName: string | undefined,
workflowRunID: number | undefined,
checkoutPath: string,
environment: string | undefined,