Merge pull request #2349 from github/aeisenberg/no-fail-upload-artifacts

This commit is contained in:
Andrew Eisenberg 2024-06-22 11:14:00 -07:00 committed by GitHub
commit 3ce5d00107
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 29 additions and 17 deletions

View file

@ -45,16 +45,22 @@ export async function uploadDebugArtifacts(
);
}
}
await artifact.create().uploadArtifact(
sanitizeArifactName(`${artifactName}${suffix}`),
toUpload.map((file) => path.normalize(file)),
path.normalize(rootDir),
{
continueOnError: true,
// ensure we don't keep the debug artifacts around for too long since they can be large.
retentionDays: 7,
},
);
try {
await artifact.create().uploadArtifact(
sanitizeArifactName(`${artifactName}${suffix}`),
toUpload.map((file) => path.normalize(file)),
path.normalize(rootDir),
{
continueOnError: true,
// 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}`);
}
}
export async function uploadSarifDebugArtifact(