don't add --new args if not requested
This commit is contained in:
parent
10cbc929b3
commit
04eca20383
6
dist/post_run/index.js
vendored
6
dist/post_run/index.js
vendored
@ -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`);
|
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`);
|
addedArgs.push(`--out-format=github-actions`);
|
||||||
if (patchPath && (userArgNames.has(`new`) || userArgNames.has(`new-from-rev`) || userArgNames.has(`new-from-patch`))) {
|
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`);
|
throw new Error(`please, don't specify manually --new* args when requesting only new issues`);
|
||||||
}
|
}
|
||||||
addedArgs.push(`--new-from-patch=${patchPath}`);
|
addedArgs.push(`--new-from-patch=${patchPath}`);
|
||||||
// Override config values.
|
// Override config values.
|
||||||
addedArgs.push(`--new=false`);
|
addedArgs.push(`--new=false`);
|
||||||
addedArgs.push(`--new-from-rev=`);
|
addedArgs.push(`--new-from-rev=`);
|
||||||
|
}
|
||||||
const workingDirectory = core.getInput(`working-directory`);
|
const workingDirectory = core.getInput(`working-directory`);
|
||||||
const cmdArgs = {};
|
const cmdArgs = {};
|
||||||
if (workingDirectory) {
|
if (workingDirectory) {
|
||||||
@ -6667,7 +6669,7 @@ function runLint(lintPath, patchPath) {
|
|||||||
cmdArgs.cwd = path.resolve(workingDirectory);
|
cmdArgs.cwd = path.resolve(workingDirectory);
|
||||||
}
|
}
|
||||||
const cmd = `${lintPath} run ${addedArgs.join(` `)} ${userArgs}`.trimRight();
|
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();
|
const startedAt = Date.now();
|
||||||
try {
|
try {
|
||||||
const res = yield execShellCommand(cmd, cmdArgs);
|
const res = yield execShellCommand(cmd, cmdArgs);
|
||||||
|
6
dist/run/index.js
vendored
6
dist/run/index.js
vendored
@ -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`);
|
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`);
|
addedArgs.push(`--out-format=github-actions`);
|
||||||
if (patchPath && (userArgNames.has(`new`) || userArgNames.has(`new-from-rev`) || userArgNames.has(`new-from-patch`))) {
|
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`);
|
throw new Error(`please, don't specify manually --new* args when requesting only new issues`);
|
||||||
}
|
}
|
||||||
addedArgs.push(`--new-from-patch=${patchPath}`);
|
addedArgs.push(`--new-from-patch=${patchPath}`);
|
||||||
// Override config values.
|
// Override config values.
|
||||||
addedArgs.push(`--new=false`);
|
addedArgs.push(`--new=false`);
|
||||||
addedArgs.push(`--new-from-rev=`);
|
addedArgs.push(`--new-from-rev=`);
|
||||||
|
}
|
||||||
const workingDirectory = core.getInput(`working-directory`);
|
const workingDirectory = core.getInput(`working-directory`);
|
||||||
const cmdArgs = {};
|
const cmdArgs = {};
|
||||||
if (workingDirectory) {
|
if (workingDirectory) {
|
||||||
@ -6679,7 +6681,7 @@ function runLint(lintPath, patchPath) {
|
|||||||
cmdArgs.cwd = path.resolve(workingDirectory);
|
cmdArgs.cwd = path.resolve(workingDirectory);
|
||||||
}
|
}
|
||||||
const cmd = `${lintPath} run ${addedArgs.join(` `)} ${userArgs}`.trimRight();
|
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();
|
const startedAt = Date.now();
|
||||||
try {
|
try {
|
||||||
const res = yield execShellCommand(cmd, cmdArgs);
|
const res = yield execShellCommand(cmd, cmdArgs);
|
||||||
|
@ -136,7 +136,8 @@ async function runLint(lintPath: string, patchPath: string): Promise<void> {
|
|||||||
}
|
}
|
||||||
addedArgs.push(`--out-format=github-actions`)
|
addedArgs.push(`--out-format=github-actions`)
|
||||||
|
|
||||||
if (patchPath && (userArgNames.has(`new`) || userArgNames.has(`new-from-rev`) || userArgNames.has(`new-from-patch`))) {
|
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`)
|
throw new Error(`please, don't specify manually --new* args when requesting only new issues`)
|
||||||
}
|
}
|
||||||
addedArgs.push(`--new-from-patch=${patchPath}`)
|
addedArgs.push(`--new-from-patch=${patchPath}`)
|
||||||
@ -144,6 +145,7 @@ async function runLint(lintPath: string, patchPath: string): Promise<void> {
|
|||||||
// Override config values.
|
// Override config values.
|
||||||
addedArgs.push(`--new=false`)
|
addedArgs.push(`--new=false`)
|
||||||
addedArgs.push(`--new-from-rev=`)
|
addedArgs.push(`--new-from-rev=`)
|
||||||
|
}
|
||||||
|
|
||||||
const workingDirectory = core.getInput(`working-directory`)
|
const workingDirectory = core.getInput(`working-directory`)
|
||||||
const cmdArgs: ExecOptions = {}
|
const cmdArgs: ExecOptions = {}
|
||||||
@ -160,7 +162,7 @@ async function runLint(lintPath: string, patchPath: string): Promise<void> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const cmd = `${lintPath} run ${addedArgs.join(` `)} ${userArgs}`.trimRight()
|
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()
|
const startedAt = Date.now()
|
||||||
try {
|
try {
|
||||||
const res = await execShellCommand(cmd, cmdArgs)
|
const res = await execShellCommand(cmd, cmdArgs)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user