diff --git a/dist/post_run/index.js b/dist/post_run/index.js index 809ad74..b7efc19 100644 --- a/dist/post_run/index.js +++ b/dist/post_run/index.js @@ -6647,13 +6647,15 @@ function runLint(lintPath, patchPath) { throw new Error(`please, don't change out-format for golangci-lint: it can be broken in a future`); } addedArgs.push(`--out-format=github-actions`); - if (patchPath && (userArgNames.has(`new`) || userArgNames.has(`new-from-rev`) || userArgNames.has(`new-from-patch`))) { - throw new Error(`please, don't specify manually --new* args when requesting only new issues`); + if (patchPath) { + if (userArgNames.has(`new`) || userArgNames.has(`new-from-rev`) || userArgNames.has(`new-from-patch`)) { + throw new Error(`please, don't specify manually --new* args when requesting only new issues`); + } + addedArgs.push(`--new-from-patch=${patchPath}`); + // Override config values. + addedArgs.push(`--new=false`); + addedArgs.push(`--new-from-rev=`); } - addedArgs.push(`--new-from-patch=${patchPath}`); - // Override config values. - addedArgs.push(`--new=false`); - addedArgs.push(`--new-from-rev=`); const workingDirectory = core.getInput(`working-directory`); const cmdArgs = {}; if (workingDirectory) { @@ -6667,7 +6669,7 @@ function runLint(lintPath, patchPath) { cmdArgs.cwd = path.resolve(workingDirectory); } const cmd = `${lintPath} run ${addedArgs.join(` `)} ${userArgs}`.trimRight(); - core.info(`Running [${cmd}] in [${cmdArgs.cwd}] ...`); + core.info(`Running [${cmd}] in [${cmdArgs.cwd || ``}] ...`); const startedAt = Date.now(); try { const res = yield execShellCommand(cmd, cmdArgs); diff --git a/dist/run/index.js b/dist/run/index.js index 174d6d0..4cd0ebc 100644 --- a/dist/run/index.js +++ b/dist/run/index.js @@ -6659,13 +6659,15 @@ function runLint(lintPath, patchPath) { throw new Error(`please, don't change out-format for golangci-lint: it can be broken in a future`); } addedArgs.push(`--out-format=github-actions`); - if (patchPath && (userArgNames.has(`new`) || userArgNames.has(`new-from-rev`) || userArgNames.has(`new-from-patch`))) { - throw new Error(`please, don't specify manually --new* args when requesting only new issues`); + if (patchPath) { + if (userArgNames.has(`new`) || userArgNames.has(`new-from-rev`) || userArgNames.has(`new-from-patch`)) { + throw new Error(`please, don't specify manually --new* args when requesting only new issues`); + } + addedArgs.push(`--new-from-patch=${patchPath}`); + // Override config values. + addedArgs.push(`--new=false`); + addedArgs.push(`--new-from-rev=`); } - addedArgs.push(`--new-from-patch=${patchPath}`); - // Override config values. - addedArgs.push(`--new=false`); - addedArgs.push(`--new-from-rev=`); const workingDirectory = core.getInput(`working-directory`); const cmdArgs = {}; if (workingDirectory) { @@ -6679,7 +6681,7 @@ function runLint(lintPath, patchPath) { cmdArgs.cwd = path.resolve(workingDirectory); } const cmd = `${lintPath} run ${addedArgs.join(` `)} ${userArgs}`.trimRight(); - core.info(`Running [${cmd}] in [${cmdArgs.cwd}] ...`); + core.info(`Running [${cmd}] in [${cmdArgs.cwd || ``}] ...`); const startedAt = Date.now(); try { const res = yield execShellCommand(cmd, cmdArgs); diff --git a/src/run.ts b/src/run.ts index f26c914..d334db0 100644 --- a/src/run.ts +++ b/src/run.ts @@ -136,14 +136,16 @@ async function runLint(lintPath: string, patchPath: string): Promise { } addedArgs.push(`--out-format=github-actions`) - if (patchPath && (userArgNames.has(`new`) || userArgNames.has(`new-from-rev`) || userArgNames.has(`new-from-patch`))) { - throw new Error(`please, don't specify manually --new* args when requesting only new issues`) - } - addedArgs.push(`--new-from-patch=${patchPath}`) + if (patchPath) { + if (userArgNames.has(`new`) || userArgNames.has(`new-from-rev`) || userArgNames.has(`new-from-patch`)) { + throw new Error(`please, don't specify manually --new* args when requesting only new issues`) + } + addedArgs.push(`--new-from-patch=${patchPath}`) - // Override config values. - addedArgs.push(`--new=false`) - addedArgs.push(`--new-from-rev=`) + // Override config values. + addedArgs.push(`--new=false`) + addedArgs.push(`--new-from-rev=`) + } const workingDirectory = core.getInput(`working-directory`) const cmdArgs: ExecOptions = {} @@ -160,7 +162,7 @@ async function runLint(lintPath: string, patchPath: string): Promise { } const cmd = `${lintPath} run ${addedArgs.join(` `)} ${userArgs}`.trimRight() - core.info(`Running [${cmd}] in [${cmdArgs.cwd}] ...`) + core.info(`Running [${cmd}] in [${cmdArgs.cwd || ``}] ...`) const startedAt = Date.now() try { const res = await execShellCommand(cmd, cmdArgs)