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

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
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

lib/debug-artifacts.js

Lines changed: 11 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: 16 additions & 10 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy