Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit af7457e

Browse files
committed
Test with unique artifact name for v4 update
1 parent 2992a95 commit af7457e

File tree

3 files changed

+23
-16
lines changed

3 files changed

+23
-16
lines changed

lib/debug-artifacts.js

Lines changed: 8 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/debug-artifacts.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/debug-artifacts.ts

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export async function uploadDebugArtifacts(
6060
try {
6161
if (ghVariant === GitHubVariant.GHES) {
6262
await artifactLegacy.create().uploadArtifact(
63-
sanitizeArifactName(`${artifactName}${suffix}`),
63+
sanitizeArifactName(`${artifactName}${suffix}}`),
6464
toUpload.map((file) => path.normalize(file)),
6565
path.normalize(rootDir),
6666
{
@@ -70,16 +70,20 @@ export async function uploadDebugArtifacts(
7070
},
7171
);
7272
} else {
73+
const normalizedFilePaths = toUpload.map((file) => path.normalize(file));
7374
const artifactClient = new artifact.DefaultArtifactClient();
74-
await artifactClient.uploadArtifact(
75-
sanitizeArifactName(`${artifactName}${suffix}`),
76-
toUpload.map((file) => path.normalize(file)),
77-
path.normalize(rootDir),
78-
{
79-
// ensure we don't keep the debug artifacts around for too long since they can be large.
80-
retentionDays: 7,
81-
},
82-
);
75+
76+
for (const file of normalizedFilePaths) {
77+
await artifactClient.uploadArtifact(
78+
sanitizeArifactName(`${artifactName}${suffix}-${file}`),
79+
[file],
80+
path.normalize(rootDir),
81+
{
82+
// ensure we don't keep the debug artifacts around for too long since they can be large.
83+
retentionDays: 7,
84+
},
85+
);
86+
}
8387
}
8488
} catch (e) {
8589
// A failure to upload debug artifacts should not fail the entire action.

0 commit comments

Comments
 (0)