Skip to content

Commit 3ce5d00

Browse files
authored
Merge pull request #2349 from github/aeisenberg/no-fail-upload-artifacts
2 parents ce5603b + e572852 commit 3ce5d00

File tree

4 files changed

+29
-17
lines changed

4 files changed

+29
-17
lines changed

Diff for: CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Note that the only difference between `v2` and `v3` of the CodeQL Action is the
66

77
## [UNRELEASED]
88

9-
No user facing changes.
9+
- Avoid failing the workflow run if there is an error while uploading debug artifacts. [#2349](https://github.com/github/codeql-action/pull/2349)
1010

1111
## 3.25.10 - 13 Jun 2024
1212

Diff for: lib/debug-artifacts.js

+11-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: lib/debug-artifacts.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: src/debug-artifacts.ts

+16-10
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,22 @@ export async function uploadDebugArtifacts(
4545
);
4646
}
4747
}
48-
await artifact.create().uploadArtifact(
49-
sanitizeArifactName(`${artifactName}${suffix}`),
50-
toUpload.map((file) => path.normalize(file)),
51-
path.normalize(rootDir),
52-
{
53-
continueOnError: true,
54-
// ensure we don't keep the debug artifacts around for too long since they can be large.
55-
retentionDays: 7,
56-
},
57-
);
48+
49+
try {
50+
await artifact.create().uploadArtifact(
51+
sanitizeArifactName(`${artifactName}${suffix}`),
52+
toUpload.map((file) => path.normalize(file)),
53+
path.normalize(rootDir),
54+
{
55+
continueOnError: true,
56+
// ensure we don't keep the debug artifacts around for too long since they can be large.
57+
retentionDays: 7,
58+
},
59+
);
60+
} catch (e) {
61+
// A failure to upload debug artifacts should not fail the entire action.
62+
core.warning(`Failed to upload debug artifacts: ${e}`);
63+
}
5864
}
5965

6066
export async function uploadSarifDebugArtifact(

0 commit comments

Comments
 (0)