mirror of
https://github.com/github/codeql-action.git
synced 2026-10-03 17:41:28 +00:00
Only echo command if we are streaming the stdout
This commit is contained in:
4
lib/actions-util.js
generated
4
lib/actions-util.js
generated
@@ -468,7 +468,9 @@ const MAX_STDERR_BUFFER_SIZE = 20000;
|
|||||||
async function runTool(cmd, args = [], opts = {}) {
|
async function runTool(cmd, args = [], opts = {}) {
|
||||||
let stdout = "";
|
let stdout = "";
|
||||||
let stderr = "";
|
let stderr = "";
|
||||||
process.stdout.write(`[command]${cmd} ${args.join(" ")}\n`);
|
if (!opts.noStreamStdout) {
|
||||||
|
process.stdout.write(`[command]${cmd} ${args.join(" ")}\n`);
|
||||||
|
}
|
||||||
const exitCode = await new toolrunner.ToolRunner(cmd, args, {
|
const exitCode = await new toolrunner.ToolRunner(cmd, args, {
|
||||||
ignoreReturnCode: true,
|
ignoreReturnCode: true,
|
||||||
listeners: {
|
listeners: {
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
2
lib/setup-codeql.js
generated
2
lib/setup-codeql.js
generated
@@ -405,7 +405,7 @@ const downloadCodeQL = async function (codeqlURL, maybeBundleVersion, maybeCliVe
|
|||||||
const toolcacheVersion = getCanonicalToolcacheVersion(maybeCliVersion, bundleVersion, logger);
|
const toolcacheVersion = getCanonicalToolcacheVersion(maybeCliVersion, bundleVersion, logger);
|
||||||
const toolcacheStart = performance.now();
|
const toolcacheStart = performance.now();
|
||||||
const toolcachedBundlePath = await toolcache.cacheDir(extractedBundlePath, "CodeQL", toolcacheVersion);
|
const toolcachedBundlePath = await toolcache.cacheDir(extractedBundlePath, "CodeQL", toolcacheVersion);
|
||||||
logger.info(`Added CodeQL bundle to the tool cache (${performance.now() - toolcacheStart} ms).`);
|
logger.info(`Added CodeQL bundle to the tool cache (${Math.round(performance.now() - toolcacheStart)} ms).`);
|
||||||
// Defensive check: we expect `cacheDir` to copy the bundle to a new location.
|
// Defensive check: we expect `cacheDir` to copy the bundle to a new location.
|
||||||
if (toolcachedBundlePath !== extractedBundlePath) {
|
if (toolcachedBundlePath !== extractedBundlePath) {
|
||||||
await (0, util_1.cleanUpGlob)(extractedBundlePath, "CodeQL bundle from temporary directory", logger);
|
await (0, util_1.cleanUpGlob)(extractedBundlePath, "CodeQL bundle from temporary directory", logger);
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -527,7 +527,9 @@ export async function runTool(
|
|||||||
): Promise<string> {
|
): Promise<string> {
|
||||||
let stdout = "";
|
let stdout = "";
|
||||||
let stderr = "";
|
let stderr = "";
|
||||||
process.stdout.write(`[command]${cmd} ${args.join(" ")}\n`);
|
if (!opts.noStreamStdout) {
|
||||||
|
process.stdout.write(`[command]${cmd} ${args.join(" ")}\n`);
|
||||||
|
}
|
||||||
const exitCode = await new toolrunner.ToolRunner(cmd, args, {
|
const exitCode = await new toolrunner.ToolRunner(cmd, args, {
|
||||||
ignoreReturnCode: true,
|
ignoreReturnCode: true,
|
||||||
listeners: {
|
listeners: {
|
||||||
|
|||||||
@@ -557,9 +557,9 @@ export const downloadCodeQL = async function (
|
|||||||
);
|
);
|
||||||
|
|
||||||
logger.info(
|
logger.info(
|
||||||
`Added CodeQL bundle to the tool cache (${
|
`Added CodeQL bundle to the tool cache (${Math.round(
|
||||||
performance.now() - toolcacheStart
|
performance.now() - toolcacheStart,
|
||||||
} ms).`,
|
)} ms).`,
|
||||||
);
|
);
|
||||||
|
|
||||||
// Defensive check: we expect `cacheDir` to copy the bundle to a new location.
|
// Defensive check: we expect `cacheDir` to copy the bundle to a new location.
|
||||||
|
|||||||
Reference in New Issue
Block a user