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 af7457e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 16 deletions.
13 changes: 8 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.

24 changes: 14 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 @@ -70,16 +70,20 @@ export async function uploadDebugArtifacts(
},
);
} else {
const normalizedFilePaths = toUpload.map((file) => path.normalize(file));
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 normalizedFilePaths) {
await artifactClient.uploadArtifact(
sanitizeArifactName(`${artifactName}${suffix}-${file}`),
[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 af7457e

Please sign in to comment.