don't add --new args if not requested

This commit is contained in:
Denis Isaev
2020-05-22 10:48:00 +03:00
parent 10cbc929b3
commit 04eca20383
3 changed files with 28 additions and 22 deletions

16
dist/run/index.js vendored
View File

@ -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);