mirror of
https://github.com/github/codeql-action.git
synced 2026-05-07 06:10:19 +00:00
Refactor: remove argument array indirection and pass directly instead
This commit is contained in:
+9
-16
@@ -268,23 +268,16 @@ export async function uploadDebugArtifacts(
|
||||
? new artifact.DefaultArtifactClient()
|
||||
: artifactLegacy.create();
|
||||
|
||||
const artifactUploaderArgs: [
|
||||
string, // artifact name
|
||||
string[], // file paths to upload
|
||||
string, // root directory
|
||||
artifact.UploadArtifactOptions,
|
||||
] = [
|
||||
sanitizeArtifactName(`${artifactName}${suffix}`),
|
||||
toUpload.map((file) => path.normalize(file)),
|
||||
path.normalize(rootDir),
|
||||
{
|
||||
// ensure we don't keep the debug artifacts around for too long since they can be large.
|
||||
retentionDays: 7,
|
||||
},
|
||||
];
|
||||
|
||||
try {
|
||||
await artifactUploader.uploadArtifact(...artifactUploaderArgs);
|
||||
await artifactUploader.uploadArtifact(
|
||||
sanitizeArtifactName(`${artifactName}${suffix}`),
|
||||
toUpload.map((file) => path.normalize(file)),
|
||||
path.normalize(rootDir),
|
||||
{
|
||||
// ensure we don't keep the debug artifacts around for too long since they can be large.
|
||||
retentionDays: 7,
|
||||
},
|
||||
);
|
||||
} catch (e) {
|
||||
// A failure to upload debug artifacts should not fail the entire action.
|
||||
core.warning(`Failed to upload debug artifacts: ${e}`);
|
||||
|
||||
@@ -70,12 +70,7 @@ async function runWrapper() {
|
||||
? new artifact.DefaultArtifactClient()
|
||||
: artifactLegacy.create();
|
||||
|
||||
const artifactUploaderArgs: [
|
||||
string, // artifact name
|
||||
string[], // file paths to upload
|
||||
string, // root directory
|
||||
artifact.UploadArtifactOptions,
|
||||
] = [
|
||||
await artifactUploader.uploadArtifact(
|
||||
"proxy-log-file",
|
||||
[logFilePath],
|
||||
actionsUtil.getTemporaryDirectory(),
|
||||
@@ -83,9 +78,7 @@ async function runWrapper() {
|
||||
// ensure we don't keep the debug artifacts around for too long since they can be large.
|
||||
retentionDays: 7,
|
||||
},
|
||||
];
|
||||
|
||||
await artifactUploader.uploadArtifact(...artifactUploaderArgs);
|
||||
);
|
||||
} catch (e) {
|
||||
// A failure to upload debug artifacts should not fail the entire action.
|
||||
core.warning(`Failed to upload debug artifacts: ${e}`);
|
||||
|
||||
Reference in New Issue
Block a user