Refactor: remove argument array indirection and pass directly instead

This commit is contained in:
Angela P Wen
2024-09-26 13:19:49 -07:00
parent 4a5884aaa5
commit 8e4d3c2dba
6 changed files with 20 additions and 46 deletions
+3 -9
View File
@@ -197,17 +197,11 @@ async function uploadDebugArtifacts(toUpload, rootDir, artifactName, ghVariant,
(await features.getValue(feature_flags_1.Feature.ArtifactUpgrade))
? new artifact.DefaultArtifactClient()
: artifactLegacy.create();
const artifactUploaderArgs = [
sanitizeArtifactName(`${artifactName}${suffix}`),
toUpload.map((file) => path.normalize(file)),
path.normalize(rootDir),
{
try {
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,
},
];
try {
await artifactUploader.uploadArtifact(...artifactUploaderArgs);
});
}
catch (e) {
// A failure to upload debug artifacts should not fail the entire action.