Skip to content

Commit

Permalink
Test with unique artifact name for v4 update
Browse files Browse the repository at this point in the history
  • Loading branch information
angelapwen committed Sep 4, 2024
1 parent 2992a95 commit 3c37ab4
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 16 deletions.
12 changes: 7 additions & 5 deletions lib/debug-artifacts.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/debug-artifacts.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 13 additions & 10 deletions src/debug-artifacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export async function uploadDebugArtifacts(
try {
if (ghVariant === GitHubVariant.GHES) {
await artifactLegacy.create().uploadArtifact(
sanitizeArifactName(`${artifactName}${suffix}`),
sanitizeArifactName(`${artifactName}${suffix}}`),
toUpload.map((file) => path.normalize(file)),
path.normalize(rootDir),
{
Expand All @@ -71,15 +71,18 @@ export async function uploadDebugArtifacts(
);
} else {
const artifactClient = new artifact.DefaultArtifactClient();
await artifactClient.uploadArtifact(
sanitizeArifactName(`${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,
},
);

for (const file of toUpload) {
await artifactClient.uploadArtifact(
sanitizeArifactName(`${artifactName}${suffix}-${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.
Expand Down

0 comments on commit 3c37ab4

Please sign in to comment.