From f5a82188bc7a18723542b58e0282fadc8dc6c34e Mon Sep 17 00:00:00 2001 From: Andrew Eisenberg Date: Wed, 10 Jan 2024 13:29:13 -0800 Subject: [PATCH] Add a retention period of 7 days For debug artifacts. Ensures they don't stick around too long since these can be large. --- CHANGELOG.md | 2 +- lib/debug-artifacts.js | 6 +++++- lib/debug-artifacts.js.map | 2 +- src/debug-artifacts.ts | 6 +++++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 480a63ac65..5bd68e73fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ Note that the only difference between `v2` and `v3` of the CodeQL Action is the ## [UNRELEASED] -No user facing changes. +- Change the retention period for uploaded debug artifacts to 7 days. Previously, this was whatever the repository default was. [#2079](https://github.com/github/codeql-action/pull/2079) ## 3.23.0 - 08 Jan 2024 diff --git a/lib/debug-artifacts.js b/lib/debug-artifacts.js index f49c5e9abc..e4956b2ce5 100644 --- a/lib/debug-artifacts.js +++ b/lib/debug-artifacts.js @@ -56,7 +56,11 @@ async function uploadDebugArtifacts(toUpload, rootDir, artifactName) { core.info("Could not parse user-specified `matrix` input into JSON. The debug artifact will not be named with the user's `matrix` input."); } } - await artifact.create().uploadArtifact(sanitizeArifactName(`${artifactName}${suffix}`), toUpload.map((file) => path.normalize(file)), path.normalize(rootDir), { continueOnError: true }); + 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, + }); } exports.uploadDebugArtifacts = uploadDebugArtifacts; async function uploadSarifDebugArtifact(config, outputDir) { diff --git a/lib/debug-artifacts.js.map b/lib/debug-artifacts.js.map index 4b7ef44c34..c8a8b2e4a9 100644 --- a/lib/debug-artifacts.js.map +++ b/lib/debug-artifacts.js.map @@ -1 +1 @@ -{"version":3,"file":"debug-artifacts.js","sourceR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,CAAC;iBAAM,CAAC;gBACN,kBAAkB,GAAG,MAAM,uBAAuB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;YACvE,CAAC;YACD,MAAM,oBAAoB,CACxB,CAAC,kBAAkB,CAAC,EACpB,MAAM,CAAC,UAAU,EACjB,MAAM,CAAC,iBAAiB,CACzB,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,IAAI,CACP,8CAA8C,MAAM,CAAC,iBAAiB,IAAI,QAAQ,KAAK,KAAK,EAAE,CAC/F,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC;AA1BD,8EA0BC"} \ No newline at end of file diff --git a/src/debug-artifacts.ts b/src/debug-artifacts.ts index ac782a11d2..91bdf46112 100644 --- a/src/debug-artifacts.ts +++ b/src/debug-artifacts.ts @@ -49,7 +49,11 @@ export async function uploadDebugArtifacts( sanitizeArifactName(`${artifactName}${suffix}`), toUpload.map((file) => path.normalize(file)), path.normalize(rootDir), - { continueOnError: true }, + { + continueOnError: true, + // ensure we don't keep the debug artifacts around for too long since they can be large. + retentionDays: 7, + }, ); }