mirror of
https://github.com/github/codeql-action.git
synced 2026-04-29 02:18:47 +00:00
Move checkWorkflow to workflow.ts
This commit is contained in:
Generated
+178
-198
File diff suppressed because it is too large
Load Diff
Generated
+424
-427
File diff suppressed because it is too large
Load Diff
Generated
+577
-572
File diff suppressed because it is too large
Load Diff
Generated
+168
-186
File diff suppressed because it is too large
Load Diff
Generated
+156
-176
@@ -19743,10 +19743,10 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
|
||||
(0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message);
|
||||
}
|
||||
exports2.error = error2;
|
||||
function warning7(message, properties = {}) {
|
||||
function warning6(message, properties = {}) {
|
||||
(0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message);
|
||||
}
|
||||
exports2.warning = warning7;
|
||||
exports2.warning = warning6;
|
||||
function notice(message, properties = {}) {
|
||||
(0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message);
|
||||
}
|
||||
@@ -19755,22 +19755,22 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
|
||||
process.stdout.write(message + os2.EOL);
|
||||
}
|
||||
exports2.info = info4;
|
||||
function startGroup4(name) {
|
||||
function startGroup3(name) {
|
||||
(0, command_1.issue)("group", name);
|
||||
}
|
||||
exports2.startGroup = startGroup4;
|
||||
function endGroup4() {
|
||||
exports2.startGroup = startGroup3;
|
||||
function endGroup3() {
|
||||
(0, command_1.issue)("endgroup");
|
||||
}
|
||||
exports2.endGroup = endGroup4;
|
||||
exports2.endGroup = endGroup3;
|
||||
function group(name, fn) {
|
||||
return __awaiter4(this, void 0, void 0, function* () {
|
||||
startGroup4(name);
|
||||
startGroup3(name);
|
||||
let result;
|
||||
try {
|
||||
result = yield fn();
|
||||
} finally {
|
||||
endGroup4();
|
||||
endGroup3();
|
||||
}
|
||||
return result;
|
||||
});
|
||||
@@ -35312,7 +35312,7 @@ var require_internal_glob_options_helper = __commonJS({
|
||||
};
|
||||
Object.defineProperty(exports2, "__esModule", { value: true });
|
||||
exports2.getOptions = void 0;
|
||||
var core14 = __importStar4(require_core());
|
||||
var core12 = __importStar4(require_core());
|
||||
function getOptions(copy) {
|
||||
const result = {
|
||||
followSymbolicLinks: true,
|
||||
@@ -35322,15 +35322,15 @@ var require_internal_glob_options_helper = __commonJS({
|
||||
if (copy) {
|
||||
if (typeof copy.followSymbolicLinks === "boolean") {
|
||||
result.followSymbolicLinks = copy.followSymbolicLinks;
|
||||
core14.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`);
|
||||
core12.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`);
|
||||
}
|
||||
if (typeof copy.implicitDescendants === "boolean") {
|
||||
result.implicitDescendants = copy.implicitDescendants;
|
||||
core14.debug(`implicitDescendants '${result.implicitDescendants}'`);
|
||||
core12.debug(`implicitDescendants '${result.implicitDescendants}'`);
|
||||
}
|
||||
if (typeof copy.omitBrokenSymbolicLinks === "boolean") {
|
||||
result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks;
|
||||
core14.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`);
|
||||
core12.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
@@ -36784,7 +36784,7 @@ var require_internal_globber = __commonJS({
|
||||
};
|
||||
Object.defineProperty(exports2, "__esModule", { value: true });
|
||||
exports2.DefaultGlobber = void 0;
|
||||
var core14 = __importStar4(require_core());
|
||||
var core12 = __importStar4(require_core());
|
||||
var fs14 = __importStar4(require("fs"));
|
||||
var globOptionsHelper = __importStar4(require_internal_glob_options_helper());
|
||||
var path15 = __importStar4(require("path"));
|
||||
@@ -36835,7 +36835,7 @@ var require_internal_globber = __commonJS({
|
||||
}
|
||||
const stack = [];
|
||||
for (const searchPath of patternHelper.getSearchPaths(patterns)) {
|
||||
core14.debug(`Search path '${searchPath}'`);
|
||||
core12.debug(`Search path '${searchPath}'`);
|
||||
try {
|
||||
yield __await4(fs14.promises.lstat(searchPath));
|
||||
} catch (err) {
|
||||
@@ -36907,7 +36907,7 @@ var require_internal_globber = __commonJS({
|
||||
} catch (err) {
|
||||
if (err.code === "ENOENT") {
|
||||
if (options.omitBrokenSymbolicLinks) {
|
||||
core14.debug(`Broken symlink '${item.path}'`);
|
||||
core12.debug(`Broken symlink '${item.path}'`);
|
||||
return void 0;
|
||||
}
|
||||
throw new Error(`No information found for the path '${item.path}'. This may indicate a broken symbolic link.`);
|
||||
@@ -36923,7 +36923,7 @@ var require_internal_globber = __commonJS({
|
||||
traversalChain.pop();
|
||||
}
|
||||
if (traversalChain.some((x) => x === realPath)) {
|
||||
core14.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`);
|
||||
core12.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`);
|
||||
return void 0;
|
||||
}
|
||||
traversalChain.push(realPath);
|
||||
@@ -38247,7 +38247,7 @@ var require_cacheUtils = __commonJS({
|
||||
};
|
||||
Object.defineProperty(exports2, "__esModule", { value: true });
|
||||
exports2.getRuntimeToken = exports2.getCacheVersion = exports2.assertDefined = exports2.getGnuTarPathOnWindows = exports2.getCacheFileName = exports2.getCompressionMethod = exports2.unlinkFile = exports2.resolvePaths = exports2.getArchiveFileSizeInBytes = exports2.createTempDirectory = void 0;
|
||||
var core14 = __importStar4(require_core());
|
||||
var core12 = __importStar4(require_core());
|
||||
var exec2 = __importStar4(require_exec());
|
||||
var glob = __importStar4(require_glob());
|
||||
var io6 = __importStar4(require_io());
|
||||
@@ -38300,7 +38300,7 @@ var require_cacheUtils = __commonJS({
|
||||
_e = false;
|
||||
const file = _c;
|
||||
const relativeFile = path15.relative(workspace, file).replace(new RegExp(`\\${path15.sep}`, "g"), "/");
|
||||
core14.debug(`Matched: ${relativeFile}`);
|
||||
core12.debug(`Matched: ${relativeFile}`);
|
||||
if (relativeFile === "") {
|
||||
paths.push(".");
|
||||
} else {
|
||||
@@ -38330,7 +38330,7 @@ var require_cacheUtils = __commonJS({
|
||||
return __awaiter4(this, void 0, void 0, function* () {
|
||||
let versionOutput = "";
|
||||
additionalArgs.push("--version");
|
||||
core14.debug(`Checking ${app} ${additionalArgs.join(" ")}`);
|
||||
core12.debug(`Checking ${app} ${additionalArgs.join(" ")}`);
|
||||
try {
|
||||
yield exec2.exec(`${app}`, additionalArgs, {
|
||||
ignoreReturnCode: true,
|
||||
@@ -38341,10 +38341,10 @@ var require_cacheUtils = __commonJS({
|
||||
}
|
||||
});
|
||||
} catch (err) {
|
||||
core14.debug(err.message);
|
||||
core12.debug(err.message);
|
||||
}
|
||||
versionOutput = versionOutput.trim();
|
||||
core14.debug(versionOutput);
|
||||
core12.debug(versionOutput);
|
||||
return versionOutput;
|
||||
});
|
||||
}
|
||||
@@ -38352,7 +38352,7 @@ var require_cacheUtils = __commonJS({
|
||||
return __awaiter4(this, void 0, void 0, function* () {
|
||||
const versionOutput = yield getVersion("zstd", ["--quiet"]);
|
||||
const version = semver8.clean(versionOutput);
|
||||
core14.debug(`zstd version: ${version}`);
|
||||
core12.debug(`zstd version: ${version}`);
|
||||
if (versionOutput === "") {
|
||||
return constants_1.CompressionMethod.Gzip;
|
||||
} else {
|
||||
@@ -73664,7 +73664,7 @@ var require_uploadUtils = __commonJS({
|
||||
};
|
||||
Object.defineProperty(exports2, "__esModule", { value: true });
|
||||
exports2.uploadCacheArchiveSDK = exports2.UploadProgress = void 0;
|
||||
var core14 = __importStar4(require_core());
|
||||
var core12 = __importStar4(require_core());
|
||||
var storage_blob_1 = require_dist7();
|
||||
var errors_1 = require_errors2();
|
||||
var UploadProgress = class {
|
||||
@@ -73706,7 +73706,7 @@ var require_uploadUtils = __commonJS({
|
||||
const percentage = (100 * (transferredBytes / this.contentLength)).toFixed(1);
|
||||
const elapsedTime = Date.now() - this.startTime;
|
||||
const uploadSpeed = (transferredBytes / (1024 * 1024) / (elapsedTime / 1e3)).toFixed(1);
|
||||
core14.info(`Sent ${transferredBytes} of ${this.contentLength} (${percentage}%), ${uploadSpeed} MBs/sec`);
|
||||
core12.info(`Sent ${transferredBytes} of ${this.contentLength} (${percentage}%), ${uploadSpeed} MBs/sec`);
|
||||
if (this.isDone()) {
|
||||
this.displayedComplete = true;
|
||||
}
|
||||
@@ -73761,14 +73761,14 @@ var require_uploadUtils = __commonJS({
|
||||
};
|
||||
try {
|
||||
uploadProgress.startDisplayTimer();
|
||||
core14.debug(`BlobClient: ${blobClient.name}:${blobClient.accountName}:${blobClient.containerName}`);
|
||||
core12.debug(`BlobClient: ${blobClient.name}:${blobClient.accountName}:${blobClient.containerName}`);
|
||||
const response = yield blockBlobClient.uploadFile(archivePath, uploadOptions);
|
||||
if (response._response.status >= 400) {
|
||||
throw new errors_1.InvalidResponseError(`uploadCacheArchiveSDK: upload failed with status code ${response._response.status}`);
|
||||
}
|
||||
return response;
|
||||
} catch (error2) {
|
||||
core14.warning(`uploadCacheArchiveSDK: internal error uploading cache archive: ${error2.message}`);
|
||||
core12.warning(`uploadCacheArchiveSDK: internal error uploading cache archive: ${error2.message}`);
|
||||
throw error2;
|
||||
} finally {
|
||||
uploadProgress.stopDisplayTimer();
|
||||
@@ -73839,7 +73839,7 @@ var require_requestUtils = __commonJS({
|
||||
};
|
||||
Object.defineProperty(exports2, "__esModule", { value: true });
|
||||
exports2.retryHttpClientResponse = exports2.retryTypedResponse = exports2.retry = exports2.isRetryableStatusCode = exports2.isServerErrorStatusCode = exports2.isSuccessStatusCode = void 0;
|
||||
var core14 = __importStar4(require_core());
|
||||
var core12 = __importStar4(require_core());
|
||||
var http_client_1 = require_lib();
|
||||
var constants_1 = require_constants10();
|
||||
function isSuccessStatusCode(statusCode) {
|
||||
@@ -73900,9 +73900,9 @@ var require_requestUtils = __commonJS({
|
||||
isRetryable = isRetryableStatusCode(statusCode);
|
||||
errorMessage = `Cache service responded with ${statusCode}`;
|
||||
}
|
||||
core14.debug(`${name} - Attempt ${attempt} of ${maxAttempts} failed with error: ${errorMessage}`);
|
||||
core12.debug(`${name} - Attempt ${attempt} of ${maxAttempts} failed with error: ${errorMessage}`);
|
||||
if (!isRetryable) {
|
||||
core14.debug(`${name} - Error is not retryable`);
|
||||
core12.debug(`${name} - Error is not retryable`);
|
||||
break;
|
||||
}
|
||||
yield sleep(delay2);
|
||||
@@ -74007,7 +74007,7 @@ var require_downloadUtils = __commonJS({
|
||||
};
|
||||
Object.defineProperty(exports2, "__esModule", { value: true });
|
||||
exports2.downloadCacheStorageSDK = exports2.downloadCacheHttpClientConcurrent = exports2.downloadCacheHttpClient = exports2.DownloadProgress = void 0;
|
||||
var core14 = __importStar4(require_core());
|
||||
var core12 = __importStar4(require_core());
|
||||
var http_client_1 = require_lib();
|
||||
var storage_blob_1 = require_dist7();
|
||||
var buffer = __importStar4(require("buffer"));
|
||||
@@ -74045,7 +74045,7 @@ var require_downloadUtils = __commonJS({
|
||||
this.segmentIndex = this.segmentIndex + 1;
|
||||
this.segmentSize = segmentSize;
|
||||
this.receivedBytes = 0;
|
||||
core14.debug(`Downloading segment at offset ${this.segmentOffset} with length ${this.segmentSize}...`);
|
||||
core12.debug(`Downloading segment at offset ${this.segmentOffset} with length ${this.segmentSize}...`);
|
||||
}
|
||||
/**
|
||||
* Sets the number of bytes received for the current segment.
|
||||
@@ -74079,7 +74079,7 @@ var require_downloadUtils = __commonJS({
|
||||
const percentage = (100 * (transferredBytes / this.contentLength)).toFixed(1);
|
||||
const elapsedTime = Date.now() - this.startTime;
|
||||
const downloadSpeed = (transferredBytes / (1024 * 1024) / (elapsedTime / 1e3)).toFixed(1);
|
||||
core14.info(`Received ${transferredBytes} of ${this.contentLength} (${percentage}%), ${downloadSpeed} MBs/sec`);
|
||||
core12.info(`Received ${transferredBytes} of ${this.contentLength} (${percentage}%), ${downloadSpeed} MBs/sec`);
|
||||
if (this.isDone()) {
|
||||
this.displayedComplete = true;
|
||||
}
|
||||
@@ -74129,7 +74129,7 @@ var require_downloadUtils = __commonJS({
|
||||
}));
|
||||
downloadResponse.message.socket.setTimeout(constants_1.SocketTimeout, () => {
|
||||
downloadResponse.message.destroy();
|
||||
core14.debug(`Aborting download, socket timed out after ${constants_1.SocketTimeout} ms`);
|
||||
core12.debug(`Aborting download, socket timed out after ${constants_1.SocketTimeout} ms`);
|
||||
});
|
||||
yield pipeResponseToStream(downloadResponse, writeStream);
|
||||
const contentLengthHeader = downloadResponse.message.headers["content-length"];
|
||||
@@ -74140,7 +74140,7 @@ var require_downloadUtils = __commonJS({
|
||||
throw new Error(`Incomplete download. Expected file size: ${expectedLength}, actual file size: ${actualLength}`);
|
||||
}
|
||||
} else {
|
||||
core14.debug("Unable to validate download, no Content-Length header");
|
||||
core12.debug("Unable to validate download, no Content-Length header");
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -74260,7 +74260,7 @@ var require_downloadUtils = __commonJS({
|
||||
const properties = yield client.getProperties();
|
||||
const contentLength = (_a = properties.contentLength) !== null && _a !== void 0 ? _a : -1;
|
||||
if (contentLength < 0) {
|
||||
core14.debug("Unable to determine content length, downloading file with http-client...");
|
||||
core12.debug("Unable to determine content length, downloading file with http-client...");
|
||||
yield downloadCacheHttpClient(archiveLocation, archivePath);
|
||||
} else {
|
||||
const maxSegmentSize = Math.min(134217728, buffer.constants.MAX_LENGTH);
|
||||
@@ -74340,7 +74340,7 @@ var require_options = __commonJS({
|
||||
};
|
||||
Object.defineProperty(exports2, "__esModule", { value: true });
|
||||
exports2.getDownloadOptions = exports2.getUploadOptions = void 0;
|
||||
var core14 = __importStar4(require_core());
|
||||
var core12 = __importStar4(require_core());
|
||||
function getUploadOptions(copy) {
|
||||
const result = {
|
||||
useAzureSdk: false,
|
||||
@@ -74360,9 +74360,9 @@ var require_options = __commonJS({
|
||||
}
|
||||
result.uploadConcurrency = !isNaN(Number(process.env["CACHE_UPLOAD_CONCURRENCY"])) ? Math.min(32, Number(process.env["CACHE_UPLOAD_CONCURRENCY"])) : result.uploadConcurrency;
|
||||
result.uploadChunkSize = !isNaN(Number(process.env["CACHE_UPLOAD_CHUNK_SIZE"])) ? Math.min(128 * 1024 * 1024, Number(process.env["CACHE_UPLOAD_CHUNK_SIZE"]) * 1024 * 1024) : result.uploadChunkSize;
|
||||
core14.debug(`Use Azure SDK: ${result.useAzureSdk}`);
|
||||
core14.debug(`Upload concurrency: ${result.uploadConcurrency}`);
|
||||
core14.debug(`Upload chunk size: ${result.uploadChunkSize}`);
|
||||
core12.debug(`Use Azure SDK: ${result.useAzureSdk}`);
|
||||
core12.debug(`Upload concurrency: ${result.uploadConcurrency}`);
|
||||
core12.debug(`Upload chunk size: ${result.uploadChunkSize}`);
|
||||
return result;
|
||||
}
|
||||
exports2.getUploadOptions = getUploadOptions;
|
||||
@@ -74399,12 +74399,12 @@ var require_options = __commonJS({
|
||||
if (segmentDownloadTimeoutMins && !isNaN(Number(segmentDownloadTimeoutMins)) && isFinite(Number(segmentDownloadTimeoutMins))) {
|
||||
result.segmentTimeoutInMs = Number(segmentDownloadTimeoutMins) * 60 * 1e3;
|
||||
}
|
||||
core14.debug(`Use Azure SDK: ${result.useAzureSdk}`);
|
||||
core14.debug(`Download concurrency: ${result.downloadConcurrency}`);
|
||||
core14.debug(`Request timeout (ms): ${result.timeoutInMs}`);
|
||||
core14.debug(`Cache segment download timeout mins env var: ${process.env["SEGMENT_DOWNLOAD_TIMEOUT_MINS"]}`);
|
||||
core14.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`);
|
||||
core14.debug(`Lookup only: ${result.lookupOnly}`);
|
||||
core12.debug(`Use Azure SDK: ${result.useAzureSdk}`);
|
||||
core12.debug(`Download concurrency: ${result.downloadConcurrency}`);
|
||||
core12.debug(`Request timeout (ms): ${result.timeoutInMs}`);
|
||||
core12.debug(`Cache segment download timeout mins env var: ${process.env["SEGMENT_DOWNLOAD_TIMEOUT_MINS"]}`);
|
||||
core12.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`);
|
||||
core12.debug(`Lookup only: ${result.lookupOnly}`);
|
||||
return result;
|
||||
}
|
||||
exports2.getDownloadOptions = getDownloadOptions;
|
||||
@@ -74584,7 +74584,7 @@ var require_cacheHttpClient = __commonJS({
|
||||
};
|
||||
Object.defineProperty(exports2, "__esModule", { value: true });
|
||||
exports2.saveCache = exports2.reserveCache = exports2.downloadCache = exports2.getCacheEntry = void 0;
|
||||
var core14 = __importStar4(require_core());
|
||||
var core12 = __importStar4(require_core());
|
||||
var http_client_1 = require_lib();
|
||||
var auth_1 = require_auth();
|
||||
var fs14 = __importStar4(require("fs"));
|
||||
@@ -74602,7 +74602,7 @@ var require_cacheHttpClient = __commonJS({
|
||||
throw new Error("Cache Service Url not found, unable to restore cache.");
|
||||
}
|
||||
const url2 = `${baseUrl}_apis/artifactcache/${resource}`;
|
||||
core14.debug(`Resource Url: ${url2}`);
|
||||
core12.debug(`Resource Url: ${url2}`);
|
||||
return url2;
|
||||
}
|
||||
function createAcceptHeader(type2, apiVersion) {
|
||||
@@ -74630,7 +74630,7 @@ var require_cacheHttpClient = __commonJS({
|
||||
return httpClient.getJson(getCacheApiUrl(resource));
|
||||
}));
|
||||
if (response.statusCode === 204) {
|
||||
if (core14.isDebug()) {
|
||||
if (core12.isDebug()) {
|
||||
yield printCachesListForDiagnostics(keys[0], httpClient, version);
|
||||
}
|
||||
return null;
|
||||
@@ -74643,9 +74643,9 @@ var require_cacheHttpClient = __commonJS({
|
||||
if (!cacheDownloadUrl) {
|
||||
throw new Error("Cache not found.");
|
||||
}
|
||||
core14.setSecret(cacheDownloadUrl);
|
||||
core14.debug(`Cache Result:`);
|
||||
core14.debug(JSON.stringify(cacheResult));
|
||||
core12.setSecret(cacheDownloadUrl);
|
||||
core12.debug(`Cache Result:`);
|
||||
core12.debug(JSON.stringify(cacheResult));
|
||||
return cacheResult;
|
||||
});
|
||||
}
|
||||
@@ -74660,10 +74660,10 @@ var require_cacheHttpClient = __commonJS({
|
||||
const cacheListResult = response.result;
|
||||
const totalCount = cacheListResult === null || cacheListResult === void 0 ? void 0 : cacheListResult.totalCount;
|
||||
if (totalCount && totalCount > 0) {
|
||||
core14.debug(`No matching cache found for cache key '${key}', version '${version} and scope ${process.env["GITHUB_REF"]}. There exist one or more cache(s) with similar key but they have different version or scope. See more info on cache matching here: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key
|
||||
core12.debug(`No matching cache found for cache key '${key}', version '${version} and scope ${process.env["GITHUB_REF"]}. There exist one or more cache(s) with similar key but they have different version or scope. See more info on cache matching here: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key
|
||||
Other caches with similar key:`);
|
||||
for (const cacheEntry of (cacheListResult === null || cacheListResult === void 0 ? void 0 : cacheListResult.artifactCaches) || []) {
|
||||
core14.debug(`Cache Key: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.cacheKey}, Cache Version: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.cacheVersion}, Cache Scope: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.scope}, Cache Created: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.creationTime}`);
|
||||
core12.debug(`Cache Key: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.cacheKey}, Cache Version: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.cacheVersion}, Cache Scope: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.scope}, Cache Created: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.creationTime}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -74708,7 +74708,7 @@ Other caches with similar key:`);
|
||||
}
|
||||
function uploadChunk(httpClient, resourceUrl, openStream, start, end) {
|
||||
return __awaiter4(this, void 0, void 0, function* () {
|
||||
core14.debug(`Uploading chunk of size ${end - start + 1} bytes at offset ${start} with content range: ${getContentRange(start, end)}`);
|
||||
core12.debug(`Uploading chunk of size ${end - start + 1} bytes at offset ${start} with content range: ${getContentRange(start, end)}`);
|
||||
const additionalHeaders = {
|
||||
"Content-Type": "application/octet-stream",
|
||||
"Content-Range": getContentRange(start, end)
|
||||
@@ -74730,7 +74730,7 @@ Other caches with similar key:`);
|
||||
const concurrency = utils.assertDefined("uploadConcurrency", uploadOptions.uploadConcurrency);
|
||||
const maxChunkSize = utils.assertDefined("uploadChunkSize", uploadOptions.uploadChunkSize);
|
||||
const parallelUploads = [...new Array(concurrency).keys()];
|
||||
core14.debug("Awaiting all uploads");
|
||||
core12.debug("Awaiting all uploads");
|
||||
let offset = 0;
|
||||
try {
|
||||
yield Promise.all(parallelUploads.map(() => __awaiter4(this, void 0, void 0, function* () {
|
||||
@@ -74773,16 +74773,16 @@ Other caches with similar key:`);
|
||||
yield (0, uploadUtils_1.uploadCacheArchiveSDK)(signedUploadURL, archivePath, options);
|
||||
} else {
|
||||
const httpClient = createHttpClient();
|
||||
core14.debug("Upload cache");
|
||||
core12.debug("Upload cache");
|
||||
yield uploadFile(httpClient, cacheId, archivePath, options);
|
||||
core14.debug("Commiting cache");
|
||||
core12.debug("Commiting cache");
|
||||
const cacheSize = utils.getArchiveFileSizeInBytes(archivePath);
|
||||
core14.info(`Cache Size: ~${Math.round(cacheSize / (1024 * 1024))} MB (${cacheSize} B)`);
|
||||
core12.info(`Cache Size: ~${Math.round(cacheSize / (1024 * 1024))} MB (${cacheSize} B)`);
|
||||
const commitCacheResponse = yield commitCache(httpClient, cacheId, cacheSize);
|
||||
if (!(0, requestUtils_1.isSuccessStatusCode)(commitCacheResponse.statusCode)) {
|
||||
throw new Error(`Cache service responded with ${commitCacheResponse.statusCode} during commit cache.`);
|
||||
}
|
||||
core14.info("Cache saved successfully");
|
||||
core12.info("Cache saved successfully");
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -80234,7 +80234,7 @@ var require_cache3 = __commonJS({
|
||||
};
|
||||
Object.defineProperty(exports2, "__esModule", { value: true });
|
||||
exports2.saveCache = exports2.restoreCache = exports2.isFeatureAvailable = exports2.FinalizeCacheError = exports2.ReserveCacheError = exports2.ValidationError = void 0;
|
||||
var core14 = __importStar4(require_core());
|
||||
var core12 = __importStar4(require_core());
|
||||
var path15 = __importStar4(require("path"));
|
||||
var utils = __importStar4(require_cacheUtils());
|
||||
var cacheHttpClient = __importStar4(require_cacheHttpClient());
|
||||
@@ -80294,7 +80294,7 @@ var require_cache3 = __commonJS({
|
||||
function restoreCache3(paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) {
|
||||
return __awaiter4(this, void 0, void 0, function* () {
|
||||
const cacheServiceVersion = (0, config_1.getCacheServiceVersion)();
|
||||
core14.debug(`Cache service version: ${cacheServiceVersion}`);
|
||||
core12.debug(`Cache service version: ${cacheServiceVersion}`);
|
||||
checkPaths(paths);
|
||||
switch (cacheServiceVersion) {
|
||||
case "v2":
|
||||
@@ -80310,8 +80310,8 @@ var require_cache3 = __commonJS({
|
||||
return __awaiter4(this, void 0, void 0, function* () {
|
||||
restoreKeys = restoreKeys || [];
|
||||
const keys = [primaryKey, ...restoreKeys];
|
||||
core14.debug("Resolved Keys:");
|
||||
core14.debug(JSON.stringify(keys));
|
||||
core12.debug("Resolved Keys:");
|
||||
core12.debug(JSON.stringify(keys));
|
||||
if (keys.length > 10) {
|
||||
throw new ValidationError(`Key Validation Error: Keys are limited to a maximum of 10.`);
|
||||
}
|
||||
@@ -80329,19 +80329,19 @@ var require_cache3 = __commonJS({
|
||||
return void 0;
|
||||
}
|
||||
if (options === null || options === void 0 ? void 0 : options.lookupOnly) {
|
||||
core14.info("Lookup only - skipping download");
|
||||
core12.info("Lookup only - skipping download");
|
||||
return cacheEntry.cacheKey;
|
||||
}
|
||||
archivePath = path15.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod));
|
||||
core14.debug(`Archive Path: ${archivePath}`);
|
||||
core12.debug(`Archive Path: ${archivePath}`);
|
||||
yield cacheHttpClient.downloadCache(cacheEntry.archiveLocation, archivePath, options);
|
||||
if (core14.isDebug()) {
|
||||
if (core12.isDebug()) {
|
||||
yield (0, tar_1.listTar)(archivePath, compressionMethod);
|
||||
}
|
||||
const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath);
|
||||
core14.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`);
|
||||
core12.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`);
|
||||
yield (0, tar_1.extractTar)(archivePath, compressionMethod);
|
||||
core14.info("Cache restored successfully");
|
||||
core12.info("Cache restored successfully");
|
||||
return cacheEntry.cacheKey;
|
||||
} catch (error2) {
|
||||
const typedError = error2;
|
||||
@@ -80349,16 +80349,16 @@ var require_cache3 = __commonJS({
|
||||
throw error2;
|
||||
} else {
|
||||
if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) {
|
||||
core14.error(`Failed to restore: ${error2.message}`);
|
||||
core12.error(`Failed to restore: ${error2.message}`);
|
||||
} else {
|
||||
core14.warning(`Failed to restore: ${error2.message}`);
|
||||
core12.warning(`Failed to restore: ${error2.message}`);
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
yield utils.unlinkFile(archivePath);
|
||||
} catch (error2) {
|
||||
core14.debug(`Failed to delete archive: ${error2}`);
|
||||
core12.debug(`Failed to delete archive: ${error2}`);
|
||||
}
|
||||
}
|
||||
return void 0;
|
||||
@@ -80369,8 +80369,8 @@ var require_cache3 = __commonJS({
|
||||
options = Object.assign(Object.assign({}, options), { useAzureSdk: true });
|
||||
restoreKeys = restoreKeys || [];
|
||||
const keys = [primaryKey, ...restoreKeys];
|
||||
core14.debug("Resolved Keys:");
|
||||
core14.debug(JSON.stringify(keys));
|
||||
core12.debug("Resolved Keys:");
|
||||
core12.debug(JSON.stringify(keys));
|
||||
if (keys.length > 10) {
|
||||
throw new ValidationError(`Key Validation Error: Keys are limited to a maximum of 10.`);
|
||||
}
|
||||
@@ -80388,30 +80388,30 @@ var require_cache3 = __commonJS({
|
||||
};
|
||||
const response = yield twirpClient.GetCacheEntryDownloadURL(request);
|
||||
if (!response.ok) {
|
||||
core14.debug(`Cache not found for version ${request.version} of keys: ${keys.join(", ")}`);
|
||||
core12.debug(`Cache not found for version ${request.version} of keys: ${keys.join(", ")}`);
|
||||
return void 0;
|
||||
}
|
||||
const isRestoreKeyMatch = request.key !== response.matchedKey;
|
||||
if (isRestoreKeyMatch) {
|
||||
core14.info(`Cache hit for restore-key: ${response.matchedKey}`);
|
||||
core12.info(`Cache hit for restore-key: ${response.matchedKey}`);
|
||||
} else {
|
||||
core14.info(`Cache hit for: ${response.matchedKey}`);
|
||||
core12.info(`Cache hit for: ${response.matchedKey}`);
|
||||
}
|
||||
if (options === null || options === void 0 ? void 0 : options.lookupOnly) {
|
||||
core14.info("Lookup only - skipping download");
|
||||
core12.info("Lookup only - skipping download");
|
||||
return response.matchedKey;
|
||||
}
|
||||
archivePath = path15.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod));
|
||||
core14.debug(`Archive path: ${archivePath}`);
|
||||
core14.debug(`Starting download of archive to: ${archivePath}`);
|
||||
core12.debug(`Archive path: ${archivePath}`);
|
||||
core12.debug(`Starting download of archive to: ${archivePath}`);
|
||||
yield cacheHttpClient.downloadCache(response.signedDownloadUrl, archivePath, options);
|
||||
const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath);
|
||||
core14.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`);
|
||||
if (core14.isDebug()) {
|
||||
core12.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`);
|
||||
if (core12.isDebug()) {
|
||||
yield (0, tar_1.listTar)(archivePath, compressionMethod);
|
||||
}
|
||||
yield (0, tar_1.extractTar)(archivePath, compressionMethod);
|
||||
core14.info("Cache restored successfully");
|
||||
core12.info("Cache restored successfully");
|
||||
return response.matchedKey;
|
||||
} catch (error2) {
|
||||
const typedError = error2;
|
||||
@@ -80419,9 +80419,9 @@ var require_cache3 = __commonJS({
|
||||
throw error2;
|
||||
} else {
|
||||
if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) {
|
||||
core14.error(`Failed to restore: ${error2.message}`);
|
||||
core12.error(`Failed to restore: ${error2.message}`);
|
||||
} else {
|
||||
core14.warning(`Failed to restore: ${error2.message}`);
|
||||
core12.warning(`Failed to restore: ${error2.message}`);
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
@@ -80430,7 +80430,7 @@ var require_cache3 = __commonJS({
|
||||
yield utils.unlinkFile(archivePath);
|
||||
}
|
||||
} catch (error2) {
|
||||
core14.debug(`Failed to delete archive: ${error2}`);
|
||||
core12.debug(`Failed to delete archive: ${error2}`);
|
||||
}
|
||||
}
|
||||
return void 0;
|
||||
@@ -80439,7 +80439,7 @@ var require_cache3 = __commonJS({
|
||||
function saveCache3(paths, key, options, enableCrossOsArchive = false) {
|
||||
return __awaiter4(this, void 0, void 0, function* () {
|
||||
const cacheServiceVersion = (0, config_1.getCacheServiceVersion)();
|
||||
core14.debug(`Cache service version: ${cacheServiceVersion}`);
|
||||
core12.debug(`Cache service version: ${cacheServiceVersion}`);
|
||||
checkPaths(paths);
|
||||
checkKey(key);
|
||||
switch (cacheServiceVersion) {
|
||||
@@ -80458,26 +80458,26 @@ var require_cache3 = __commonJS({
|
||||
const compressionMethod = yield utils.getCompressionMethod();
|
||||
let cacheId = -1;
|
||||
const cachePaths = yield utils.resolvePaths(paths);
|
||||
core14.debug("Cache Paths:");
|
||||
core14.debug(`${JSON.stringify(cachePaths)}`);
|
||||
core12.debug("Cache Paths:");
|
||||
core12.debug(`${JSON.stringify(cachePaths)}`);
|
||||
if (cachePaths.length === 0) {
|
||||
throw new Error(`Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.`);
|
||||
}
|
||||
const archiveFolder = yield utils.createTempDirectory();
|
||||
const archivePath = path15.join(archiveFolder, utils.getCacheFileName(compressionMethod));
|
||||
core14.debug(`Archive Path: ${archivePath}`);
|
||||
core12.debug(`Archive Path: ${archivePath}`);
|
||||
try {
|
||||
yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod);
|
||||
if (core14.isDebug()) {
|
||||
if (core12.isDebug()) {
|
||||
yield (0, tar_1.listTar)(archivePath, compressionMethod);
|
||||
}
|
||||
const fileSizeLimit = 10 * 1024 * 1024 * 1024;
|
||||
const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath);
|
||||
core14.debug(`File Size: ${archiveFileSize}`);
|
||||
core12.debug(`File Size: ${archiveFileSize}`);
|
||||
if (archiveFileSize > fileSizeLimit && !(0, config_1.isGhes)()) {
|
||||
throw new Error(`Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the 10GB limit, not saving cache.`);
|
||||
}
|
||||
core14.debug("Reserving Cache");
|
||||
core12.debug("Reserving Cache");
|
||||
const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, {
|
||||
compressionMethod,
|
||||
enableCrossOsArchive,
|
||||
@@ -80490,26 +80490,26 @@ var require_cache3 = __commonJS({
|
||||
} else {
|
||||
throw new ReserveCacheError(`Unable to reserve cache with key ${key}, another job may be creating this cache. More details: ${(_e = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.error) === null || _e === void 0 ? void 0 : _e.message}`);
|
||||
}
|
||||
core14.debug(`Saving Cache (ID: ${cacheId})`);
|
||||
core12.debug(`Saving Cache (ID: ${cacheId})`);
|
||||
yield cacheHttpClient.saveCache(cacheId, archivePath, "", options);
|
||||
} catch (error2) {
|
||||
const typedError = error2;
|
||||
if (typedError.name === ValidationError.name) {
|
||||
throw error2;
|
||||
} else if (typedError.name === ReserveCacheError.name) {
|
||||
core14.info(`Failed to save: ${typedError.message}`);
|
||||
core12.info(`Failed to save: ${typedError.message}`);
|
||||
} else {
|
||||
if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) {
|
||||
core14.error(`Failed to save: ${typedError.message}`);
|
||||
core12.error(`Failed to save: ${typedError.message}`);
|
||||
} else {
|
||||
core14.warning(`Failed to save: ${typedError.message}`);
|
||||
core12.warning(`Failed to save: ${typedError.message}`);
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
yield utils.unlinkFile(archivePath);
|
||||
} catch (error2) {
|
||||
core14.debug(`Failed to delete archive: ${error2}`);
|
||||
core12.debug(`Failed to delete archive: ${error2}`);
|
||||
}
|
||||
}
|
||||
return cacheId;
|
||||
@@ -80522,23 +80522,23 @@ var require_cache3 = __commonJS({
|
||||
const twirpClient = cacheTwirpClient.internalCacheTwirpClient();
|
||||
let cacheId = -1;
|
||||
const cachePaths = yield utils.resolvePaths(paths);
|
||||
core14.debug("Cache Paths:");
|
||||
core14.debug(`${JSON.stringify(cachePaths)}`);
|
||||
core12.debug("Cache Paths:");
|
||||
core12.debug(`${JSON.stringify(cachePaths)}`);
|
||||
if (cachePaths.length === 0) {
|
||||
throw new Error(`Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.`);
|
||||
}
|
||||
const archiveFolder = yield utils.createTempDirectory();
|
||||
const archivePath = path15.join(archiveFolder, utils.getCacheFileName(compressionMethod));
|
||||
core14.debug(`Archive Path: ${archivePath}`);
|
||||
core12.debug(`Archive Path: ${archivePath}`);
|
||||
try {
|
||||
yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod);
|
||||
if (core14.isDebug()) {
|
||||
if (core12.isDebug()) {
|
||||
yield (0, tar_1.listTar)(archivePath, compressionMethod);
|
||||
}
|
||||
const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath);
|
||||
core14.debug(`File Size: ${archiveFileSize}`);
|
||||
core12.debug(`File Size: ${archiveFileSize}`);
|
||||
options.archiveSizeBytes = archiveFileSize;
|
||||
core14.debug("Reserving Cache");
|
||||
core12.debug("Reserving Cache");
|
||||
const version = utils.getCacheVersion(paths, compressionMethod, enableCrossOsArchive);
|
||||
const request = {
|
||||
key,
|
||||
@@ -80549,16 +80549,16 @@ var require_cache3 = __commonJS({
|
||||
const response = yield twirpClient.CreateCacheEntry(request);
|
||||
if (!response.ok) {
|
||||
if (response.message) {
|
||||
core14.warning(`Cache reservation failed: ${response.message}`);
|
||||
core12.warning(`Cache reservation failed: ${response.message}`);
|
||||
}
|
||||
throw new Error(response.message || "Response was not ok");
|
||||
}
|
||||
signedUploadUrl = response.signedUploadUrl;
|
||||
} catch (error2) {
|
||||
core14.debug(`Failed to reserve cache: ${error2}`);
|
||||
core12.debug(`Failed to reserve cache: ${error2}`);
|
||||
throw new ReserveCacheError(`Unable to reserve cache with key ${key}, another job may be creating this cache.`);
|
||||
}
|
||||
core14.debug(`Attempting to upload cache located at: ${archivePath}`);
|
||||
core12.debug(`Attempting to upload cache located at: ${archivePath}`);
|
||||
yield cacheHttpClient.saveCache(cacheId, archivePath, signedUploadUrl, options);
|
||||
const finalizeRequest = {
|
||||
key,
|
||||
@@ -80566,7 +80566,7 @@ var require_cache3 = __commonJS({
|
||||
sizeBytes: `${archiveFileSize}`
|
||||
};
|
||||
const finalizeResponse = yield twirpClient.FinalizeCacheEntryUpload(finalizeRequest);
|
||||
core14.debug(`FinalizeCacheEntryUploadResponse: ${finalizeResponse.ok}`);
|
||||
core12.debug(`FinalizeCacheEntryUploadResponse: ${finalizeResponse.ok}`);
|
||||
if (!finalizeResponse.ok) {
|
||||
if (finalizeResponse.message) {
|
||||
throw new FinalizeCacheError(finalizeResponse.message);
|
||||
@@ -80579,21 +80579,21 @@ var require_cache3 = __commonJS({
|
||||
if (typedError.name === ValidationError.name) {
|
||||
throw error2;
|
||||
} else if (typedError.name === ReserveCacheError.name) {
|
||||
core14.info(`Failed to save: ${typedError.message}`);
|
||||
core12.info(`Failed to save: ${typedError.message}`);
|
||||
} else if (typedError.name === FinalizeCacheError.name) {
|
||||
core14.warning(typedError.message);
|
||||
core12.warning(typedError.message);
|
||||
} else {
|
||||
if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) {
|
||||
core14.error(`Failed to save: ${typedError.message}`);
|
||||
core12.error(`Failed to save: ${typedError.message}`);
|
||||
} else {
|
||||
core14.warning(`Failed to save: ${typedError.message}`);
|
||||
core12.warning(`Failed to save: ${typedError.message}`);
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
yield utils.unlinkFile(archivePath);
|
||||
} catch (error2) {
|
||||
core14.debug(`Failed to delete archive: ${error2}`);
|
||||
core12.debug(`Failed to delete archive: ${error2}`);
|
||||
}
|
||||
}
|
||||
return cacheId;
|
||||
@@ -80801,7 +80801,7 @@ var require_retry_helper = __commonJS({
|
||||
};
|
||||
Object.defineProperty(exports2, "__esModule", { value: true });
|
||||
exports2.RetryHelper = void 0;
|
||||
var core14 = __importStar4(require_core());
|
||||
var core12 = __importStar4(require_core());
|
||||
var RetryHelper = class {
|
||||
constructor(maxAttempts, minSeconds, maxSeconds) {
|
||||
if (maxAttempts < 1) {
|
||||
@@ -80824,10 +80824,10 @@ var require_retry_helper = __commonJS({
|
||||
if (isRetryable && !isRetryable(err)) {
|
||||
throw err;
|
||||
}
|
||||
core14.info(err.message);
|
||||
core12.info(err.message);
|
||||
}
|
||||
const seconds = this.getSleepAmount();
|
||||
core14.info(`Waiting ${seconds} seconds before trying again`);
|
||||
core12.info(`Waiting ${seconds} seconds before trying again`);
|
||||
yield this.sleep(seconds);
|
||||
attempt++;
|
||||
}
|
||||
@@ -80907,7 +80907,7 @@ var require_tool_cache = __commonJS({
|
||||
};
|
||||
Object.defineProperty(exports2, "__esModule", { value: true });
|
||||
exports2.evaluateVersions = exports2.isExplicitVersion = exports2.findFromManifest = exports2.getManifestFromRepo = exports2.findAllVersions = exports2.find = exports2.cacheFile = exports2.cacheDir = exports2.extractZip = exports2.extractXar = exports2.extractTar = exports2.extract7z = exports2.downloadTool = exports2.HTTPError = void 0;
|
||||
var core14 = __importStar4(require_core());
|
||||
var core12 = __importStar4(require_core());
|
||||
var io6 = __importStar4(require_io());
|
||||
var crypto = __importStar4(require("crypto"));
|
||||
var fs14 = __importStar4(require("fs"));
|
||||
@@ -80936,8 +80936,8 @@ var require_tool_cache = __commonJS({
|
||||
return __awaiter4(this, void 0, void 0, function* () {
|
||||
dest = dest || path15.join(_getTempDirectory(), crypto.randomUUID());
|
||||
yield io6.mkdirP(path15.dirname(dest));
|
||||
core14.debug(`Downloading ${url2}`);
|
||||
core14.debug(`Destination ${dest}`);
|
||||
core12.debug(`Downloading ${url2}`);
|
||||
core12.debug(`Destination ${dest}`);
|
||||
const maxAttempts = 3;
|
||||
const minSeconds = _getGlobal("TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS", 10);
|
||||
const maxSeconds = _getGlobal("TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS", 20);
|
||||
@@ -80964,7 +80964,7 @@ var require_tool_cache = __commonJS({
|
||||
allowRetries: false
|
||||
});
|
||||
if (auth) {
|
||||
core14.debug("set auth");
|
||||
core12.debug("set auth");
|
||||
if (headers === void 0) {
|
||||
headers = {};
|
||||
}
|
||||
@@ -80973,7 +80973,7 @@ var require_tool_cache = __commonJS({
|
||||
const response = yield http.get(url2, headers);
|
||||
if (response.message.statusCode !== 200) {
|
||||
const err = new HTTPError2(response.message.statusCode);
|
||||
core14.debug(`Failed to download from "${url2}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
|
||||
core12.debug(`Failed to download from "${url2}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
|
||||
throw err;
|
||||
}
|
||||
const pipeline = util.promisify(stream2.pipeline);
|
||||
@@ -80982,16 +80982,16 @@ var require_tool_cache = __commonJS({
|
||||
let succeeded = false;
|
||||
try {
|
||||
yield pipeline(readStream, fs14.createWriteStream(dest));
|
||||
core14.debug("download complete");
|
||||
core12.debug("download complete");
|
||||
succeeded = true;
|
||||
return dest;
|
||||
} finally {
|
||||
if (!succeeded) {
|
||||
core14.debug("download failed");
|
||||
core12.debug("download failed");
|
||||
try {
|
||||
yield io6.rmRF(dest);
|
||||
} catch (err) {
|
||||
core14.debug(`Failed to delete '${dest}'. ${err.message}`);
|
||||
core12.debug(`Failed to delete '${dest}'. ${err.message}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -81006,7 +81006,7 @@ var require_tool_cache = __commonJS({
|
||||
process.chdir(dest);
|
||||
if (_7zPath) {
|
||||
try {
|
||||
const logLevel = core14.isDebug() ? "-bb1" : "-bb0";
|
||||
const logLevel = core12.isDebug() ? "-bb1" : "-bb0";
|
||||
const args = [
|
||||
"x",
|
||||
logLevel,
|
||||
@@ -81056,7 +81056,7 @@ var require_tool_cache = __commonJS({
|
||||
throw new Error("parameter 'file' is required");
|
||||
}
|
||||
dest = yield _createExtractFolder(dest);
|
||||
core14.debug("Checking tar --version");
|
||||
core12.debug("Checking tar --version");
|
||||
let versionOutput = "";
|
||||
yield (0, exec_1.exec)("tar --version", [], {
|
||||
ignoreReturnCode: true,
|
||||
@@ -81066,7 +81066,7 @@ var require_tool_cache = __commonJS({
|
||||
stderr: (data) => versionOutput += data.toString()
|
||||
}
|
||||
});
|
||||
core14.debug(versionOutput.trim());
|
||||
core12.debug(versionOutput.trim());
|
||||
const isGnuTar = versionOutput.toUpperCase().includes("GNU TAR");
|
||||
let args;
|
||||
if (flags instanceof Array) {
|
||||
@@ -81074,7 +81074,7 @@ var require_tool_cache = __commonJS({
|
||||
} else {
|
||||
args = [flags];
|
||||
}
|
||||
if (core14.isDebug() && !flags.includes("v")) {
|
||||
if (core12.isDebug() && !flags.includes("v")) {
|
||||
args.push("-v");
|
||||
}
|
||||
let destArg = dest;
|
||||
@@ -81106,7 +81106,7 @@ var require_tool_cache = __commonJS({
|
||||
args = [flags];
|
||||
}
|
||||
args.push("-x", "-C", dest, "-f", file);
|
||||
if (core14.isDebug()) {
|
||||
if (core12.isDebug()) {
|
||||
args.push("-v");
|
||||
}
|
||||
const xarPath = yield io6.which("xar", true);
|
||||
@@ -81151,7 +81151,7 @@ var require_tool_cache = __commonJS({
|
||||
"-Command",
|
||||
pwshCommand
|
||||
];
|
||||
core14.debug(`Using pwsh at path: ${pwshPath}`);
|
||||
core12.debug(`Using pwsh at path: ${pwshPath}`);
|
||||
yield (0, exec_1.exec)(`"${pwshPath}"`, args);
|
||||
} else {
|
||||
const powershellCommand = [
|
||||
@@ -81171,7 +81171,7 @@ var require_tool_cache = __commonJS({
|
||||
powershellCommand
|
||||
];
|
||||
const powershellPath = yield io6.which("powershell", true);
|
||||
core14.debug(`Using powershell at path: ${powershellPath}`);
|
||||
core12.debug(`Using powershell at path: ${powershellPath}`);
|
||||
yield (0, exec_1.exec)(`"${powershellPath}"`, args);
|
||||
}
|
||||
});
|
||||
@@ -81180,7 +81180,7 @@ var require_tool_cache = __commonJS({
|
||||
return __awaiter4(this, void 0, void 0, function* () {
|
||||
const unzipPath = yield io6.which("unzip", true);
|
||||
const args = [file];
|
||||
if (!core14.isDebug()) {
|
||||
if (!core12.isDebug()) {
|
||||
args.unshift("-q");
|
||||
}
|
||||
args.unshift("-o");
|
||||
@@ -81191,8 +81191,8 @@ var require_tool_cache = __commonJS({
|
||||
return __awaiter4(this, void 0, void 0, function* () {
|
||||
version = semver8.clean(version) || version;
|
||||
arch2 = arch2 || os2.arch();
|
||||
core14.debug(`Caching tool ${tool} ${version} ${arch2}`);
|
||||
core14.debug(`source dir: ${sourceDir}`);
|
||||
core12.debug(`Caching tool ${tool} ${version} ${arch2}`);
|
||||
core12.debug(`source dir: ${sourceDir}`);
|
||||
if (!fs14.statSync(sourceDir).isDirectory()) {
|
||||
throw new Error("sourceDir is not a directory");
|
||||
}
|
||||
@@ -81210,14 +81210,14 @@ var require_tool_cache = __commonJS({
|
||||
return __awaiter4(this, void 0, void 0, function* () {
|
||||
version = semver8.clean(version) || version;
|
||||
arch2 = arch2 || os2.arch();
|
||||
core14.debug(`Caching tool ${tool} ${version} ${arch2}`);
|
||||
core14.debug(`source file: ${sourceFile}`);
|
||||
core12.debug(`Caching tool ${tool} ${version} ${arch2}`);
|
||||
core12.debug(`source file: ${sourceFile}`);
|
||||
if (!fs14.statSync(sourceFile).isFile()) {
|
||||
throw new Error("sourceFile is not a file");
|
||||
}
|
||||
const destFolder = yield _createToolPath(tool, version, arch2);
|
||||
const destPath = path15.join(destFolder, targetFile);
|
||||
core14.debug(`destination file ${destPath}`);
|
||||
core12.debug(`destination file ${destPath}`);
|
||||
yield io6.cp(sourceFile, destPath);
|
||||
_completeToolPath(tool, version, arch2);
|
||||
return destFolder;
|
||||
@@ -81241,12 +81241,12 @@ var require_tool_cache = __commonJS({
|
||||
if (versionSpec) {
|
||||
versionSpec = semver8.clean(versionSpec) || "";
|
||||
const cachePath = path15.join(_getCacheDirectory(), toolName, versionSpec, arch2);
|
||||
core14.debug(`checking cache: ${cachePath}`);
|
||||
core12.debug(`checking cache: ${cachePath}`);
|
||||
if (fs14.existsSync(cachePath) && fs14.existsSync(`${cachePath}.complete`)) {
|
||||
core14.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch2}`);
|
||||
core12.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch2}`);
|
||||
toolPath = cachePath;
|
||||
} else {
|
||||
core14.debug("not found");
|
||||
core12.debug("not found");
|
||||
}
|
||||
}
|
||||
return toolPath;
|
||||
@@ -81277,7 +81277,7 @@ var require_tool_cache = __commonJS({
|
||||
const http = new httpm.HttpClient("tool-cache");
|
||||
const headers = {};
|
||||
if (auth) {
|
||||
core14.debug("set auth");
|
||||
core12.debug("set auth");
|
||||
headers.authorization = auth;
|
||||
}
|
||||
const response = yield http.getJson(treeUrl, headers);
|
||||
@@ -81298,7 +81298,7 @@ var require_tool_cache = __commonJS({
|
||||
try {
|
||||
releases = JSON.parse(versionsRaw);
|
||||
} catch (_a) {
|
||||
core14.debug("Invalid json");
|
||||
core12.debug("Invalid json");
|
||||
}
|
||||
}
|
||||
return releases;
|
||||
@@ -81324,7 +81324,7 @@ var require_tool_cache = __commonJS({
|
||||
function _createToolPath(tool, version, arch2) {
|
||||
return __awaiter4(this, void 0, void 0, function* () {
|
||||
const folderPath = path15.join(_getCacheDirectory(), tool, semver8.clean(version) || version, arch2 || "");
|
||||
core14.debug(`destination ${folderPath}`);
|
||||
core12.debug(`destination ${folderPath}`);
|
||||
const markerPath = `${folderPath}.complete`;
|
||||
yield io6.rmRF(folderPath);
|
||||
yield io6.rmRF(markerPath);
|
||||
@@ -81336,19 +81336,19 @@ var require_tool_cache = __commonJS({
|
||||
const folderPath = path15.join(_getCacheDirectory(), tool, semver8.clean(version) || version, arch2 || "");
|
||||
const markerPath = `${folderPath}.complete`;
|
||||
fs14.writeFileSync(markerPath, "");
|
||||
core14.debug("finished caching tool");
|
||||
core12.debug("finished caching tool");
|
||||
}
|
||||
function isExplicitVersion(versionSpec) {
|
||||
const c = semver8.clean(versionSpec) || "";
|
||||
core14.debug(`isExplicit: ${c}`);
|
||||
core12.debug(`isExplicit: ${c}`);
|
||||
const valid3 = semver8.valid(c) != null;
|
||||
core14.debug(`explicit? ${valid3}`);
|
||||
core12.debug(`explicit? ${valid3}`);
|
||||
return valid3;
|
||||
}
|
||||
exports2.isExplicitVersion = isExplicitVersion;
|
||||
function evaluateVersions(versions, versionSpec) {
|
||||
let version = "";
|
||||
core14.debug(`evaluating ${versions.length} versions`);
|
||||
core12.debug(`evaluating ${versions.length} versions`);
|
||||
versions = versions.sort((a, b) => {
|
||||
if (semver8.gt(a, b)) {
|
||||
return 1;
|
||||
@@ -81364,9 +81364,9 @@ var require_tool_cache = __commonJS({
|
||||
}
|
||||
}
|
||||
if (version) {
|
||||
core14.debug(`matched: ${version}`);
|
||||
core12.debug(`matched: ${version}`);
|
||||
} else {
|
||||
core14.debug("match not found");
|
||||
core12.debug("match not found");
|
||||
}
|
||||
return version;
|
||||
}
|
||||
@@ -84866,7 +84866,7 @@ var fs13 = __toESM(require("fs"));
|
||||
var path14 = __toESM(require("path"));
|
||||
var url = __toESM(require("url"));
|
||||
var import_zlib = __toESM(require("zlib"));
|
||||
var core13 = __toESM(require_core());
|
||||
var core11 = __toESM(require_core());
|
||||
var jsonschema2 = __toESM(require_lib2());
|
||||
|
||||
// src/actions-util.ts
|
||||
@@ -92279,28 +92279,8 @@ async function addFingerprints(sarif, sourceRoot, logger) {
|
||||
}
|
||||
|
||||
// src/init.ts
|
||||
var core12 = __toESM(require_core());
|
||||
var toolrunner4 = __toESM(require_toolrunner());
|
||||
var io5 = __toESM(require_io());
|
||||
|
||||
// src/workflow.ts
|
||||
var core11 = __toESM(require_core());
|
||||
function toCodedErrors(errors) {
|
||||
return Object.entries(errors).reduce(
|
||||
(acc, [code, message]) => {
|
||||
acc[code] = { message, code };
|
||||
return acc;
|
||||
},
|
||||
{}
|
||||
);
|
||||
}
|
||||
var WorkflowErrors = toCodedErrors({
|
||||
MissingPushHook: `Please specify an on.push hook to analyze and see code scanning alerts from the default branch on the Security tab.`,
|
||||
CheckoutWrongHead: `git checkout HEAD^2 is no longer necessary. Please remove this step as Code Scanning recommends analyzing the merge commit for best results.`,
|
||||
InconsistentActionVersion: `Not all workflow steps that use \`github/codeql-action\` actions use the same version. Please ensure that all such steps use the same version to avoid compatibility issues.`
|
||||
});
|
||||
|
||||
// src/init.ts
|
||||
async function initCodeQL(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, features, logger) {
|
||||
logger.startGroup("Setup CodeQL tools");
|
||||
const {
|
||||
@@ -92430,7 +92410,7 @@ async function combineSarifFilesUsingCLI(sarifFiles, gitHubVersion, features, lo
|
||||
logger.warning(
|
||||
`Uploading multiple SARIF runs with the same category is deprecated ${deprecationWarningMessage}. Please update your workflow to upload a single run per category. ${deprecationMoreInformationMessage}`
|
||||
);
|
||||
core13.exportVariable("CODEQL_MERGE_SARIF_DEPRECATION_WARNING", "true");
|
||||
core11.exportVariable("CODEQL_MERGE_SARIF_DEPRECATION_WARNING", "true");
|
||||
}
|
||||
return combineSarifFiles(sarifFiles, logger);
|
||||
}
|
||||
@@ -92529,13 +92509,13 @@ async function uploadPayload(payload, repositoryNwo, logger, analysis) {
|
||||
if (httpError !== void 0) {
|
||||
switch (httpError.status) {
|
||||
case 403:
|
||||
core13.warning(httpError.message || GENERIC_403_MSG);
|
||||
core11.warning(httpError.message || GENERIC_403_MSG);
|
||||
break;
|
||||
case 404:
|
||||
core13.warning(httpError.message || GENERIC_404_MSG);
|
||||
core11.warning(httpError.message || GENERIC_404_MSG);
|
||||
break;
|
||||
default:
|
||||
core13.warning(httpError.message);
|
||||
core11.warning(httpError.message);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -92665,9 +92645,9 @@ function validateSarifFileSchema(sarif, sarifFilePath, logger) {
|
||||
const warnings = (result.errors ?? []).filter(
|
||||
(err) => err.name === "format" && typeof err.argument === "string" && warningAttributes.includes(err.argument)
|
||||
);
|
||||
for (const warning7 of warnings) {
|
||||
for (const warning6 of warnings) {
|
||||
logger.info(
|
||||
`Warning: '${warning7.instance}' is not a valid URI in '${warning7.property}'.`
|
||||
`Warning: '${warning6.instance}' is not a valid URI in '${warning6.property}'.`
|
||||
);
|
||||
}
|
||||
if (errors.length > 0) {
|
||||
@@ -92966,7 +92946,7 @@ function validateUniqueCategory(sarif, sentinelPrefix) {
|
||||
`Aborting upload: only one run of the codeql/analyze or codeql/upload-sarif actions is allowed per job per tool/category. The easiest fix is to specify a unique value for the \`category\` input. If .runs[].automationDetails.id is specified in the sarif file, that will take precedence over your configured \`category\`. Category: (${id ? id : "none"}) Tool: (${tool ? tool : "none"})`
|
||||
);
|
||||
}
|
||||
core13.exportVariable(sentinelEnvVar, sentinelEnvVar);
|
||||
core11.exportVariable(sentinelEnvVar, sentinelEnvVar);
|
||||
}
|
||||
}
|
||||
function sanitize(str2) {
|
||||
|
||||
Generated
+162
-182
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user