Skip to content

Commit

Permalink
Merge pull request #2349 from github/aeisenberg/no-fail-upload-artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
aeisenberg authored Jun 22, 2024
2 parents ce5603b + e572852 commit 3ce5d00
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 17 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Note that the only difference between `v2` and `v3` of the CodeQL Action is the

## [UNRELEASED]

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

## 3.25.10 - 13 Jun 2024

Expand Down
16 changes: 11 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.

26 changes: 16 additions & 10 deletions src/debug-artifacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,22 @@ export async function uploadDebugArtifacts(
);
}
}
await artifact.create().uploadArtifact(
sanitizeArifactName(`${artifactName}${suffix}`),
toUpload.map((file) => path.normalize(file)),
path.normalize(rootDir),
{
continueOnError: true,
// ensure we don't keep the debug artifacts around for too long since they can be large.
retentionDays: 7,
},
);

try {
await artifact.create().uploadArtifact(
sanitizeArifactName(`${artifactName}${suffix}`),
toUpload.map((file) => path.normalize(file)),
path.normalize(rootDir),
{
continueOnError: true,
// 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.
core.warning(`Failed to upload debug artifacts: ${e}`);
}
}

export async function uploadSarifDebugArtifact(
Expand Down

0 comments on commit 3ce5d00

Please sign in to comment.