Skip to content

Commit 94155a7

Browse files
committed
Avoid logging each extract call
1 parent 8f31052 commit 94155a7

File tree

4 files changed

+47
-11
lines changed

4 files changed

+47
-11
lines changed

lib/analyze-action-post.js

Lines changed: 12 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/init-action-post.js

Lines changed: 12 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/upload-sarif-action-post.js

Lines changed: 12 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/artifact-scanner.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ async function scanArchiveFile(
124124
if (fileName.endsWith(".tar.gz") || fileName.endsWith(".tgz")) {
125125
// Extract tar.gz files
126126
logger.debug(`Extracting tar.gz file: ${archivePath}`);
127-
await exec.exec("tar", ["-xzf", archivePath, "-C", tempExtractDir]);
127+
await exec.exec("tar", ["-xzf", archivePath, "-C", tempExtractDir], {
128+
silent: true,
129+
});
128130
} else if (fileName.endsWith(".gz")) {
129131
// Extract .gz files (single file compression)
130132
logger.debug(`Extracting gz file: ${archivePath}`);
@@ -134,11 +136,18 @@ async function scanArchiveFile(
134136
);
135137
await exec.exec("gunzip", ["-c", archivePath], {
136138
outStream: fs.createWriteStream(outputFile),
139+
silent: true,
137140
});
138141
} else if (fileName.endsWith(".zip")) {
139142
// Extract zip files
140143
logger.debug(`Extracting zip file: ${archivePath}`);
141-
await exec.exec("unzip", ["-q", "-o", archivePath, "-d", tempExtractDir]);
144+
await exec.exec(
145+
"unzip",
146+
["-q", "-o", archivePath, "-d", tempExtractDir],
147+
{
148+
silent: true,
149+
},
150+
);
142151
}
143152

144153
// Scan the extracted contents

0 commit comments

Comments
 (0)