Add log messages at INFO level about which artifact version used

This commit is contained in:
Angela P Wen
2024-09-26 13:33:43 -07:00
parent bca51cd79e
commit ce99e3489b
9 changed files with 77 additions and 25 deletions

View File

@@ -64,10 +64,19 @@ async function runWrapper() {
try {
// `@actions/artifact@v2` is not yet supported on GHES so the legacy version of the client will be used on GHES
// until it is supported. We also use the legacy version of the client if the feature flag is disabled.
const artifactUploader = config?.gitHubVersion.type !== util_1.GitHubVariant.GHES &&
(await features.getValue(feature_flags_1.Feature.ArtifactV2Upgrade))
? new artifact.DefaultArtifactClient()
: artifactLegacy.create();
let artifactUploader;
if (gitHubVersion.type === util_1.GitHubVariant.GHES) {
logger.info("Uploading debug artifacts using the `@actions/artifact@v1` client because the `v2` version is not yet supported on GHES.");
artifactUploader = artifactLegacy.create();
}
else if (!(await features.getValue(feature_flags_1.Feature.ArtifactV2Upgrade))) {
logger.info("Uploading debug artifacts using the `@actions/artifact@v1` client because the value of the relevant feature flag is false. To use the `v2` version of the client, set the `CODEQL_ACTION_ARTIFACT_V2_UPGRADE` environment variable to true.");
artifactUploader = artifactLegacy.create();
}
else {
logger.info("Uploading debug artifacts using the `@actions/artifact@v2` client.");
artifactUploader = new artifact.DefaultArtifactClient();
}
await artifactUploader.uploadArtifact("proxy-log-file", [logFilePath], actionsUtil.getTemporaryDirectory(), {
// ensure we don't keep the debug artifacts around for too long since they can be large.
retentionDays: 7,