mirror of
				https://gitea.com/actions/cache.git
				synced 2025-11-02 07:47:08 +00:00 
			
		
		
		
	Compare commits
	
		
			4 Commits
		
	
	
		
			v3.1.0-bet
			...
			v3.1.0-bet
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					f33ca902b8 | ||
| 
						 | 
					d48d03435b | ||
| 
						 | 
					593e91a38b | ||
| 
						 | 
					e4c2242eff | 
@@ -46,6 +46,3 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
### 3.1.0-beta.2
 | 
					### 3.1.0-beta.2
 | 
				
			||||||
- Added support for fallback to gzip to restore old caches on windows.
 | 
					- Added support for fallback to gzip to restore old caches on windows.
 | 
				
			||||||
 | 
					 | 
				
			||||||
### 3.1.0-beta.3
 | 
					 | 
				
			||||||
- Bug fixes for bsdtar fallback if gnutar not available and gzip fallback if cache saved using old cache action on windows.
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										95
									
								
								dist/restore/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										95
									
								
								dist/restore/index.js
									
									
									
									
										vendored
									
									
								
							@@ -3432,7 +3432,6 @@ function getCacheEntry(keys, paths, options) {
 | 
				
			|||||||
        const resource = `cache?keys=${encodeURIComponent(keys.join(','))}&version=${version}`;
 | 
					        const resource = `cache?keys=${encodeURIComponent(keys.join(','))}&version=${version}`;
 | 
				
			||||||
        const response = yield requestUtils_1.retryTypedResponse('getCacheEntry', () => __awaiter(this, void 0, void 0, function* () { return httpClient.getJson(getCacheApiUrl(resource)); }));
 | 
					        const response = yield requestUtils_1.retryTypedResponse('getCacheEntry', () => __awaiter(this, void 0, void 0, function* () { return httpClient.getJson(getCacheApiUrl(resource)); }));
 | 
				
			||||||
        if (response.statusCode === 204) {
 | 
					        if (response.statusCode === 204) {
 | 
				
			||||||
            // Cache not found
 | 
					 | 
				
			||||||
            return null;
 | 
					            return null;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        if (!requestUtils_1.isSuccessStatusCode(response.statusCode)) {
 | 
					        if (!requestUtils_1.isSuccessStatusCode(response.statusCode)) {
 | 
				
			||||||
@@ -3441,7 +3440,6 @@ function getCacheEntry(keys, paths, options) {
 | 
				
			|||||||
        const cacheResult = response.result;
 | 
					        const cacheResult = response.result;
 | 
				
			||||||
        const cacheDownloadUrl = cacheResult === null || cacheResult === void 0 ? void 0 : cacheResult.archiveLocation;
 | 
					        const cacheDownloadUrl = cacheResult === null || cacheResult === void 0 ? void 0 : cacheResult.archiveLocation;
 | 
				
			||||||
        if (!cacheDownloadUrl) {
 | 
					        if (!cacheDownloadUrl) {
 | 
				
			||||||
            // Cache achiveLocation not found. This should never happen, and hence bail out.
 | 
					 | 
				
			||||||
            throw new Error('Cache not found.');
 | 
					            throw new Error('Cache not found.');
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        core.setSecret(cacheDownloadUrl);
 | 
					        core.setSecret(cacheDownloadUrl);
 | 
				
			||||||
@@ -38036,7 +38034,7 @@ const path = __importStar(__webpack_require__(622));
 | 
				
			|||||||
const utils = __importStar(__webpack_require__(15));
 | 
					const utils = __importStar(__webpack_require__(15));
 | 
				
			||||||
const constants_1 = __webpack_require__(931);
 | 
					const constants_1 = __webpack_require__(931);
 | 
				
			||||||
const IS_WINDOWS = process.platform === 'win32';
 | 
					const IS_WINDOWS = process.platform === 'win32';
 | 
				
			||||||
// Returns tar path and type: BSD or GNU
 | 
					// Function also mutates the args array. For non-mutation call with passing an empty array.
 | 
				
			||||||
function getTarPath() {
 | 
					function getTarPath() {
 | 
				
			||||||
    return __awaiter(this, void 0, void 0, function* () {
 | 
					    return __awaiter(this, void 0, void 0, function* () {
 | 
				
			||||||
        switch (process.platform) {
 | 
					        switch (process.platform) {
 | 
				
			||||||
@@ -38068,7 +38066,6 @@ function getTarPath() {
 | 
				
			|||||||
            default:
 | 
					            default:
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        // Default assumption is GNU tar is present in path
 | 
					 | 
				
			||||||
        return {
 | 
					        return {
 | 
				
			||||||
            path: yield io.which('tar', true),
 | 
					            path: yield io.which('tar', true),
 | 
				
			||||||
            type: constants_1.ArchiveToolType.GNU
 | 
					            type: constants_1.ArchiveToolType.GNU
 | 
				
			||||||
@@ -38082,7 +38079,6 @@ function getTarArgs(tarPath, compressionMethod, type, archivePath = '') {
 | 
				
			|||||||
        const cacheFileName = utils.getCacheFileName(compressionMethod);
 | 
					        const cacheFileName = utils.getCacheFileName(compressionMethod);
 | 
				
			||||||
        const tarFile = 'cache.tar';
 | 
					        const tarFile = 'cache.tar';
 | 
				
			||||||
        const workingDirectory = getWorkingDirectory();
 | 
					        const workingDirectory = getWorkingDirectory();
 | 
				
			||||||
        // Speficic args for BSD tar on windows for workaround
 | 
					 | 
				
			||||||
        const BSD_TAR_ZSTD = tarPath.type === constants_1.ArchiveToolType.BSD &&
 | 
					        const BSD_TAR_ZSTD = tarPath.type === constants_1.ArchiveToolType.BSD &&
 | 
				
			||||||
            compressionMethod !== constants_1.CompressionMethod.Gzip &&
 | 
					            compressionMethod !== constants_1.CompressionMethod.Gzip &&
 | 
				
			||||||
            IS_WINDOWS;
 | 
					            IS_WINDOWS;
 | 
				
			||||||
@@ -38120,10 +38116,8 @@ function getTarArgs(tarPath, compressionMethod, type, archivePath = '') {
 | 
				
			|||||||
        return args;
 | 
					        return args;
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
// Returns commands to run tar and compression program
 | 
					function getArgs(compressionMethod, type, archivePath = '') {
 | 
				
			||||||
function getCommands(compressionMethod, type, archivePath = '') {
 | 
					 | 
				
			||||||
    return __awaiter(this, void 0, void 0, function* () {
 | 
					    return __awaiter(this, void 0, void 0, function* () {
 | 
				
			||||||
        let args;
 | 
					 | 
				
			||||||
        const tarPath = yield getTarPath();
 | 
					        const tarPath = yield getTarPath();
 | 
				
			||||||
        const tarArgs = yield getTarArgs(tarPath, compressionMethod, type, archivePath);
 | 
					        const tarArgs = yield getTarArgs(tarPath, compressionMethod, type, archivePath);
 | 
				
			||||||
        const compressionArgs = type !== 'create'
 | 
					        const compressionArgs = type !== 'create'
 | 
				
			||||||
@@ -38133,15 +38127,11 @@ function getCommands(compressionMethod, type, archivePath = '') {
 | 
				
			|||||||
            compressionMethod !== constants_1.CompressionMethod.Gzip &&
 | 
					            compressionMethod !== constants_1.CompressionMethod.Gzip &&
 | 
				
			||||||
            IS_WINDOWS;
 | 
					            IS_WINDOWS;
 | 
				
			||||||
        if (BSD_TAR_ZSTD && type !== 'create') {
 | 
					        if (BSD_TAR_ZSTD && type !== 'create') {
 | 
				
			||||||
            args = [[...compressionArgs].join(' '), [...tarArgs].join(' ')];
 | 
					            return [...compressionArgs, ...tarArgs].join(' ');
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        else {
 | 
					        else {
 | 
				
			||||||
            args = [[...tarArgs].join(' '), [...compressionArgs].join(' ')];
 | 
					            return [...tarArgs, ...compressionArgs].join(' ');
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        if (BSD_TAR_ZSTD) {
 | 
					 | 
				
			||||||
            return args;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        return [args.join(' ')];
 | 
					 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
function getWorkingDirectory() {
 | 
					function getWorkingDirectory() {
 | 
				
			||||||
@@ -38164,7 +38154,8 @@ function getDecompressionProgram(tarPath, compressionMethod, archivePath) {
 | 
				
			|||||||
                    ? [
 | 
					                    ? [
 | 
				
			||||||
                        'zstd -d --long=30 -o',
 | 
					                        'zstd -d --long=30 -o',
 | 
				
			||||||
                        constants_1.TarFilename,
 | 
					                        constants_1.TarFilename,
 | 
				
			||||||
                        archivePath.replace(new RegExp(`\\${path.sep}`, 'g'), '/')
 | 
					                        archivePath.replace(new RegExp(`\\${path.sep}`, 'g'), '/'),
 | 
				
			||||||
 | 
					                        '&&'
 | 
				
			||||||
                    ]
 | 
					                    ]
 | 
				
			||||||
                    : [
 | 
					                    : [
 | 
				
			||||||
                        '--use-compress-program',
 | 
					                        '--use-compress-program',
 | 
				
			||||||
@@ -38175,7 +38166,8 @@ function getDecompressionProgram(tarPath, compressionMethod, archivePath) {
 | 
				
			|||||||
                    ? [
 | 
					                    ? [
 | 
				
			||||||
                        'zstd -d -o',
 | 
					                        'zstd -d -o',
 | 
				
			||||||
                        constants_1.TarFilename,
 | 
					                        constants_1.TarFilename,
 | 
				
			||||||
                        archivePath.replace(new RegExp(`\\${path.sep}`, 'g'), '/')
 | 
					                        archivePath.replace(new RegExp(`\\${path.sep}`, 'g'), '/'),
 | 
				
			||||||
 | 
					                        '&&'
 | 
				
			||||||
                    ]
 | 
					                    ]
 | 
				
			||||||
                    : ['--use-compress-program', IS_WINDOWS ? '"zstd -d"' : 'unzstd'];
 | 
					                    : ['--use-compress-program', IS_WINDOWS ? '"zstd -d"' : 'unzstd'];
 | 
				
			||||||
            default:
 | 
					            default:
 | 
				
			||||||
@@ -38183,7 +38175,6 @@ function getDecompressionProgram(tarPath, compressionMethod, archivePath) {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
// Used for creating the archive
 | 
					 | 
				
			||||||
// -T#: Compress using # working thread. If # is 0, attempt to detect and use the number of physical CPU cores.
 | 
					// -T#: Compress using # working thread. If # is 0, attempt to detect and use the number of physical CPU cores.
 | 
				
			||||||
// zstdmt is equivalent to 'zstd -T0'
 | 
					// zstdmt is equivalent to 'zstd -T0'
 | 
				
			||||||
// --long=#: Enables long distance matching with # bits. Maximum is 30 (1GB) on 32-bit OS and 31 (2GB) on 64-bit.
 | 
					// --long=#: Enables long distance matching with # bits. Maximum is 30 (1GB) on 32-bit OS and 31 (2GB) on 64-bit.
 | 
				
			||||||
@@ -38199,6 +38190,7 @@ function getCompressionProgram(tarPath, compressionMethod) {
 | 
				
			|||||||
            case constants_1.CompressionMethod.Zstd:
 | 
					            case constants_1.CompressionMethod.Zstd:
 | 
				
			||||||
                return BSD_TAR_ZSTD
 | 
					                return BSD_TAR_ZSTD
 | 
				
			||||||
                    ? [
 | 
					                    ? [
 | 
				
			||||||
 | 
					                        '&&',
 | 
				
			||||||
                        'zstd -T0 --long=30 -o',
 | 
					                        'zstd -T0 --long=30 -o',
 | 
				
			||||||
                        cacheFileName.replace(new RegExp(`\\${path.sep}`, 'g'), '/'),
 | 
					                        cacheFileName.replace(new RegExp(`\\${path.sep}`, 'g'), '/'),
 | 
				
			||||||
                        constants_1.TarFilename
 | 
					                        constants_1.TarFilename
 | 
				
			||||||
@@ -38210,6 +38202,7 @@ function getCompressionProgram(tarPath, compressionMethod) {
 | 
				
			|||||||
            case constants_1.CompressionMethod.ZstdWithoutLong:
 | 
					            case constants_1.CompressionMethod.ZstdWithoutLong:
 | 
				
			||||||
                return BSD_TAR_ZSTD
 | 
					                return BSD_TAR_ZSTD
 | 
				
			||||||
                    ? [
 | 
					                    ? [
 | 
				
			||||||
 | 
					                        '&&',
 | 
				
			||||||
                        'zstd -T0 -o',
 | 
					                        'zstd -T0 -o',
 | 
				
			||||||
                        cacheFileName.replace(new RegExp(`\\${path.sep}`, 'g'), '/'),
 | 
					                        cacheFileName.replace(new RegExp(`\\${path.sep}`, 'g'), '/'),
 | 
				
			||||||
                        constants_1.TarFilename
 | 
					                        constants_1.TarFilename
 | 
				
			||||||
@@ -38220,45 +38213,44 @@ function getCompressionProgram(tarPath, compressionMethod) {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
// Executes all commands as separate processes
 | 
					function listTar(archivePath, compressionMethod) {
 | 
				
			||||||
function execCommands(commands, cwd) {
 | 
					 | 
				
			||||||
    return __awaiter(this, void 0, void 0, function* () {
 | 
					    return __awaiter(this, void 0, void 0, function* () {
 | 
				
			||||||
        for (const command of commands) {
 | 
					        const args = yield getArgs(compressionMethod, 'list', archivePath);
 | 
				
			||||||
            try {
 | 
					        try {
 | 
				
			||||||
                yield exec_1.exec(command, undefined, { cwd });
 | 
					            yield exec_1.exec(args);
 | 
				
			||||||
            }
 | 
					        }
 | 
				
			||||||
            catch (error) {
 | 
					        catch (error) {
 | 
				
			||||||
                throw new Error(`${command.split(' ')[0]} failed with error: ${error === null || error === void 0 ? void 0 : error.message}`);
 | 
					            throw new Error(`Tar failed with error: ${error === null || error === void 0 ? void 0 : error.message}`);
 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
// List the contents of a tar
 | 
					 | 
				
			||||||
function listTar(archivePath, compressionMethod) {
 | 
					 | 
				
			||||||
    return __awaiter(this, void 0, void 0, function* () {
 | 
					 | 
				
			||||||
        const commands = yield getCommands(compressionMethod, 'list', archivePath);
 | 
					 | 
				
			||||||
        yield execCommands(commands);
 | 
					 | 
				
			||||||
    });
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
exports.listTar = listTar;
 | 
					exports.listTar = listTar;
 | 
				
			||||||
// Extract a tar
 | 
					 | 
				
			||||||
function extractTar(archivePath, compressionMethod) {
 | 
					function extractTar(archivePath, compressionMethod) {
 | 
				
			||||||
    return __awaiter(this, void 0, void 0, function* () {
 | 
					    return __awaiter(this, void 0, void 0, function* () {
 | 
				
			||||||
        // Create directory to extract tar into
 | 
					        // Create directory to extract tar into
 | 
				
			||||||
        const workingDirectory = getWorkingDirectory();
 | 
					        const workingDirectory = getWorkingDirectory();
 | 
				
			||||||
        yield io.mkdirP(workingDirectory);
 | 
					        yield io.mkdirP(workingDirectory);
 | 
				
			||||||
        const commands = yield getCommands(compressionMethod, 'extract', archivePath);
 | 
					        const args = yield getArgs(compressionMethod, 'extract', archivePath);
 | 
				
			||||||
        yield execCommands(commands);
 | 
					        try {
 | 
				
			||||||
 | 
					            yield exec_1.exec(args);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        catch (error) {
 | 
				
			||||||
 | 
					            throw new Error(`Tar failed with error: ${error === null || error === void 0 ? void 0 : error.message}`);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
exports.extractTar = extractTar;
 | 
					exports.extractTar = extractTar;
 | 
				
			||||||
// Create a tar
 | 
					 | 
				
			||||||
function createTar(archiveFolder, sourceDirectories, compressionMethod) {
 | 
					function createTar(archiveFolder, sourceDirectories, compressionMethod) {
 | 
				
			||||||
    return __awaiter(this, void 0, void 0, function* () {
 | 
					    return __awaiter(this, void 0, void 0, function* () {
 | 
				
			||||||
        // Write source directories to manifest.txt to avoid command length limits
 | 
					        // Write source directories to manifest.txt to avoid command length limits
 | 
				
			||||||
        fs_1.writeFileSync(path.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join('\n'));
 | 
					        fs_1.writeFileSync(path.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join('\n'));
 | 
				
			||||||
        const commands = yield getCommands(compressionMethod, 'create');
 | 
					        const args = yield getArgs(compressionMethod, 'create');
 | 
				
			||||||
        yield execCommands(commands, archiveFolder);
 | 
					        try {
 | 
				
			||||||
 | 
					            yield exec_1.exec(args, undefined, { cwd: archiveFolder });
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        catch (error) {
 | 
				
			||||||
 | 
					            throw new Error(`Tar failed with error: ${error === null || error === void 0 ? void 0 : error.message}`);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
exports.createTar = createTar;
 | 
					exports.createTar = createTar;
 | 
				
			||||||
@@ -47155,12 +47147,15 @@ function restoreCache(paths, primaryKey, restoreKeys, options) {
 | 
				
			|||||||
        let compressionMethod = yield utils.getCompressionMethod();
 | 
					        let compressionMethod = yield utils.getCompressionMethod();
 | 
				
			||||||
        let archivePath = '';
 | 
					        let archivePath = '';
 | 
				
			||||||
        try {
 | 
					        try {
 | 
				
			||||||
            // path are needed to compute version
 | 
					            try {
 | 
				
			||||||
            cacheEntry = yield cacheHttpClient.getCacheEntry(keys, paths, {
 | 
					                // path are needed to compute version
 | 
				
			||||||
                compressionMethod
 | 
					                cacheEntry = yield cacheHttpClient.getCacheEntry(keys, paths, {
 | 
				
			||||||
            });
 | 
					                    compressionMethod
 | 
				
			||||||
            if (!(cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.archiveLocation)) {
 | 
					                });
 | 
				
			||||||
                // This is to support the old cache entry created by gzip on windows.
 | 
					            }
 | 
				
			||||||
 | 
					            catch (error) {
 | 
				
			||||||
 | 
					                // This is to support the old cache entry created
 | 
				
			||||||
 | 
					                // by the old version of the cache action on windows.
 | 
				
			||||||
                if (process.platform === 'win32' &&
 | 
					                if (process.platform === 'win32' &&
 | 
				
			||||||
                    compressionMethod !== constants_1.CompressionMethod.Gzip) {
 | 
					                    compressionMethod !== constants_1.CompressionMethod.Gzip) {
 | 
				
			||||||
                    compressionMethod = constants_1.CompressionMethod.Gzip;
 | 
					                    compressionMethod = constants_1.CompressionMethod.Gzip;
 | 
				
			||||||
@@ -47168,15 +47163,17 @@ function restoreCache(paths, primaryKey, restoreKeys, options) {
 | 
				
			|||||||
                        compressionMethod
 | 
					                        compressionMethod
 | 
				
			||||||
                    });
 | 
					                    });
 | 
				
			||||||
                    if (!(cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.archiveLocation)) {
 | 
					                    if (!(cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.archiveLocation)) {
 | 
				
			||||||
                        return undefined;
 | 
					                        throw error;
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    core.debug("Couldn't find cache entry with zstd compression, falling back to gzip compression.");
 | 
					 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                else {
 | 
					                else {
 | 
				
			||||||
                    // Cache not found
 | 
					                    throw error;
 | 
				
			||||||
                    return undefined;
 | 
					 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					            if (!(cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.archiveLocation)) {
 | 
				
			||||||
 | 
					                // Cache not found
 | 
				
			||||||
 | 
					                return undefined;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
            archivePath = path.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod));
 | 
					            archivePath = path.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod));
 | 
				
			||||||
            core.debug(`Archive Path: ${archivePath}`);
 | 
					            core.debug(`Archive Path: ${archivePath}`);
 | 
				
			||||||
            // Download the cache from the cache entry
 | 
					            // Download the cache from the cache entry
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										95
									
								
								dist/save/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										95
									
								
								dist/save/index.js
									
									
									
									
										vendored
									
									
								
							@@ -3432,7 +3432,6 @@ function getCacheEntry(keys, paths, options) {
 | 
				
			|||||||
        const resource = `cache?keys=${encodeURIComponent(keys.join(','))}&version=${version}`;
 | 
					        const resource = `cache?keys=${encodeURIComponent(keys.join(','))}&version=${version}`;
 | 
				
			||||||
        const response = yield requestUtils_1.retryTypedResponse('getCacheEntry', () => __awaiter(this, void 0, void 0, function* () { return httpClient.getJson(getCacheApiUrl(resource)); }));
 | 
					        const response = yield requestUtils_1.retryTypedResponse('getCacheEntry', () => __awaiter(this, void 0, void 0, function* () { return httpClient.getJson(getCacheApiUrl(resource)); }));
 | 
				
			||||||
        if (response.statusCode === 204) {
 | 
					        if (response.statusCode === 204) {
 | 
				
			||||||
            // Cache not found
 | 
					 | 
				
			||||||
            return null;
 | 
					            return null;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        if (!requestUtils_1.isSuccessStatusCode(response.statusCode)) {
 | 
					        if (!requestUtils_1.isSuccessStatusCode(response.statusCode)) {
 | 
				
			||||||
@@ -3441,7 +3440,6 @@ function getCacheEntry(keys, paths, options) {
 | 
				
			|||||||
        const cacheResult = response.result;
 | 
					        const cacheResult = response.result;
 | 
				
			||||||
        const cacheDownloadUrl = cacheResult === null || cacheResult === void 0 ? void 0 : cacheResult.archiveLocation;
 | 
					        const cacheDownloadUrl = cacheResult === null || cacheResult === void 0 ? void 0 : cacheResult.archiveLocation;
 | 
				
			||||||
        if (!cacheDownloadUrl) {
 | 
					        if (!cacheDownloadUrl) {
 | 
				
			||||||
            // Cache achiveLocation not found. This should never happen, and hence bail out.
 | 
					 | 
				
			||||||
            throw new Error('Cache not found.');
 | 
					            throw new Error('Cache not found.');
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        core.setSecret(cacheDownloadUrl);
 | 
					        core.setSecret(cacheDownloadUrl);
 | 
				
			||||||
@@ -38036,7 +38034,7 @@ const path = __importStar(__webpack_require__(622));
 | 
				
			|||||||
const utils = __importStar(__webpack_require__(15));
 | 
					const utils = __importStar(__webpack_require__(15));
 | 
				
			||||||
const constants_1 = __webpack_require__(931);
 | 
					const constants_1 = __webpack_require__(931);
 | 
				
			||||||
const IS_WINDOWS = process.platform === 'win32';
 | 
					const IS_WINDOWS = process.platform === 'win32';
 | 
				
			||||||
// Returns tar path and type: BSD or GNU
 | 
					// Function also mutates the args array. For non-mutation call with passing an empty array.
 | 
				
			||||||
function getTarPath() {
 | 
					function getTarPath() {
 | 
				
			||||||
    return __awaiter(this, void 0, void 0, function* () {
 | 
					    return __awaiter(this, void 0, void 0, function* () {
 | 
				
			||||||
        switch (process.platform) {
 | 
					        switch (process.platform) {
 | 
				
			||||||
@@ -38068,7 +38066,6 @@ function getTarPath() {
 | 
				
			|||||||
            default:
 | 
					            default:
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        // Default assumption is GNU tar is present in path
 | 
					 | 
				
			||||||
        return {
 | 
					        return {
 | 
				
			||||||
            path: yield io.which('tar', true),
 | 
					            path: yield io.which('tar', true),
 | 
				
			||||||
            type: constants_1.ArchiveToolType.GNU
 | 
					            type: constants_1.ArchiveToolType.GNU
 | 
				
			||||||
@@ -38082,7 +38079,6 @@ function getTarArgs(tarPath, compressionMethod, type, archivePath = '') {
 | 
				
			|||||||
        const cacheFileName = utils.getCacheFileName(compressionMethod);
 | 
					        const cacheFileName = utils.getCacheFileName(compressionMethod);
 | 
				
			||||||
        const tarFile = 'cache.tar';
 | 
					        const tarFile = 'cache.tar';
 | 
				
			||||||
        const workingDirectory = getWorkingDirectory();
 | 
					        const workingDirectory = getWorkingDirectory();
 | 
				
			||||||
        // Speficic args for BSD tar on windows for workaround
 | 
					 | 
				
			||||||
        const BSD_TAR_ZSTD = tarPath.type === constants_1.ArchiveToolType.BSD &&
 | 
					        const BSD_TAR_ZSTD = tarPath.type === constants_1.ArchiveToolType.BSD &&
 | 
				
			||||||
            compressionMethod !== constants_1.CompressionMethod.Gzip &&
 | 
					            compressionMethod !== constants_1.CompressionMethod.Gzip &&
 | 
				
			||||||
            IS_WINDOWS;
 | 
					            IS_WINDOWS;
 | 
				
			||||||
@@ -38120,10 +38116,8 @@ function getTarArgs(tarPath, compressionMethod, type, archivePath = '') {
 | 
				
			|||||||
        return args;
 | 
					        return args;
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
// Returns commands to run tar and compression program
 | 
					function getArgs(compressionMethod, type, archivePath = '') {
 | 
				
			||||||
function getCommands(compressionMethod, type, archivePath = '') {
 | 
					 | 
				
			||||||
    return __awaiter(this, void 0, void 0, function* () {
 | 
					    return __awaiter(this, void 0, void 0, function* () {
 | 
				
			||||||
        let args;
 | 
					 | 
				
			||||||
        const tarPath = yield getTarPath();
 | 
					        const tarPath = yield getTarPath();
 | 
				
			||||||
        const tarArgs = yield getTarArgs(tarPath, compressionMethod, type, archivePath);
 | 
					        const tarArgs = yield getTarArgs(tarPath, compressionMethod, type, archivePath);
 | 
				
			||||||
        const compressionArgs = type !== 'create'
 | 
					        const compressionArgs = type !== 'create'
 | 
				
			||||||
@@ -38133,15 +38127,11 @@ function getCommands(compressionMethod, type, archivePath = '') {
 | 
				
			|||||||
            compressionMethod !== constants_1.CompressionMethod.Gzip &&
 | 
					            compressionMethod !== constants_1.CompressionMethod.Gzip &&
 | 
				
			||||||
            IS_WINDOWS;
 | 
					            IS_WINDOWS;
 | 
				
			||||||
        if (BSD_TAR_ZSTD && type !== 'create') {
 | 
					        if (BSD_TAR_ZSTD && type !== 'create') {
 | 
				
			||||||
            args = [[...compressionArgs].join(' '), [...tarArgs].join(' ')];
 | 
					            return [...compressionArgs, ...tarArgs].join(' ');
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        else {
 | 
					        else {
 | 
				
			||||||
            args = [[...tarArgs].join(' '), [...compressionArgs].join(' ')];
 | 
					            return [...tarArgs, ...compressionArgs].join(' ');
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        if (BSD_TAR_ZSTD) {
 | 
					 | 
				
			||||||
            return args;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        return [args.join(' ')];
 | 
					 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
function getWorkingDirectory() {
 | 
					function getWorkingDirectory() {
 | 
				
			||||||
@@ -38164,7 +38154,8 @@ function getDecompressionProgram(tarPath, compressionMethod, archivePath) {
 | 
				
			|||||||
                    ? [
 | 
					                    ? [
 | 
				
			||||||
                        'zstd -d --long=30 -o',
 | 
					                        'zstd -d --long=30 -o',
 | 
				
			||||||
                        constants_1.TarFilename,
 | 
					                        constants_1.TarFilename,
 | 
				
			||||||
                        archivePath.replace(new RegExp(`\\${path.sep}`, 'g'), '/')
 | 
					                        archivePath.replace(new RegExp(`\\${path.sep}`, 'g'), '/'),
 | 
				
			||||||
 | 
					                        '&&'
 | 
				
			||||||
                    ]
 | 
					                    ]
 | 
				
			||||||
                    : [
 | 
					                    : [
 | 
				
			||||||
                        '--use-compress-program',
 | 
					                        '--use-compress-program',
 | 
				
			||||||
@@ -38175,7 +38166,8 @@ function getDecompressionProgram(tarPath, compressionMethod, archivePath) {
 | 
				
			|||||||
                    ? [
 | 
					                    ? [
 | 
				
			||||||
                        'zstd -d -o',
 | 
					                        'zstd -d -o',
 | 
				
			||||||
                        constants_1.TarFilename,
 | 
					                        constants_1.TarFilename,
 | 
				
			||||||
                        archivePath.replace(new RegExp(`\\${path.sep}`, 'g'), '/')
 | 
					                        archivePath.replace(new RegExp(`\\${path.sep}`, 'g'), '/'),
 | 
				
			||||||
 | 
					                        '&&'
 | 
				
			||||||
                    ]
 | 
					                    ]
 | 
				
			||||||
                    : ['--use-compress-program', IS_WINDOWS ? '"zstd -d"' : 'unzstd'];
 | 
					                    : ['--use-compress-program', IS_WINDOWS ? '"zstd -d"' : 'unzstd'];
 | 
				
			||||||
            default:
 | 
					            default:
 | 
				
			||||||
@@ -38183,7 +38175,6 @@ function getDecompressionProgram(tarPath, compressionMethod, archivePath) {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
// Used for creating the archive
 | 
					 | 
				
			||||||
// -T#: Compress using # working thread. If # is 0, attempt to detect and use the number of physical CPU cores.
 | 
					// -T#: Compress using # working thread. If # is 0, attempt to detect and use the number of physical CPU cores.
 | 
				
			||||||
// zstdmt is equivalent to 'zstd -T0'
 | 
					// zstdmt is equivalent to 'zstd -T0'
 | 
				
			||||||
// --long=#: Enables long distance matching with # bits. Maximum is 30 (1GB) on 32-bit OS and 31 (2GB) on 64-bit.
 | 
					// --long=#: Enables long distance matching with # bits. Maximum is 30 (1GB) on 32-bit OS and 31 (2GB) on 64-bit.
 | 
				
			||||||
@@ -38199,6 +38190,7 @@ function getCompressionProgram(tarPath, compressionMethod) {
 | 
				
			|||||||
            case constants_1.CompressionMethod.Zstd:
 | 
					            case constants_1.CompressionMethod.Zstd:
 | 
				
			||||||
                return BSD_TAR_ZSTD
 | 
					                return BSD_TAR_ZSTD
 | 
				
			||||||
                    ? [
 | 
					                    ? [
 | 
				
			||||||
 | 
					                        '&&',
 | 
				
			||||||
                        'zstd -T0 --long=30 -o',
 | 
					                        'zstd -T0 --long=30 -o',
 | 
				
			||||||
                        cacheFileName.replace(new RegExp(`\\${path.sep}`, 'g'), '/'),
 | 
					                        cacheFileName.replace(new RegExp(`\\${path.sep}`, 'g'), '/'),
 | 
				
			||||||
                        constants_1.TarFilename
 | 
					                        constants_1.TarFilename
 | 
				
			||||||
@@ -38210,6 +38202,7 @@ function getCompressionProgram(tarPath, compressionMethod) {
 | 
				
			|||||||
            case constants_1.CompressionMethod.ZstdWithoutLong:
 | 
					            case constants_1.CompressionMethod.ZstdWithoutLong:
 | 
				
			||||||
                return BSD_TAR_ZSTD
 | 
					                return BSD_TAR_ZSTD
 | 
				
			||||||
                    ? [
 | 
					                    ? [
 | 
				
			||||||
 | 
					                        '&&',
 | 
				
			||||||
                        'zstd -T0 -o',
 | 
					                        'zstd -T0 -o',
 | 
				
			||||||
                        cacheFileName.replace(new RegExp(`\\${path.sep}`, 'g'), '/'),
 | 
					                        cacheFileName.replace(new RegExp(`\\${path.sep}`, 'g'), '/'),
 | 
				
			||||||
                        constants_1.TarFilename
 | 
					                        constants_1.TarFilename
 | 
				
			||||||
@@ -38220,45 +38213,44 @@ function getCompressionProgram(tarPath, compressionMethod) {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
// Executes all commands as separate processes
 | 
					function listTar(archivePath, compressionMethod) {
 | 
				
			||||||
function execCommands(commands, cwd) {
 | 
					 | 
				
			||||||
    return __awaiter(this, void 0, void 0, function* () {
 | 
					    return __awaiter(this, void 0, void 0, function* () {
 | 
				
			||||||
        for (const command of commands) {
 | 
					        const args = yield getArgs(compressionMethod, 'list', archivePath);
 | 
				
			||||||
            try {
 | 
					        try {
 | 
				
			||||||
                yield exec_1.exec(command, undefined, { cwd });
 | 
					            yield exec_1.exec(args);
 | 
				
			||||||
            }
 | 
					        }
 | 
				
			||||||
            catch (error) {
 | 
					        catch (error) {
 | 
				
			||||||
                throw new Error(`${command.split(' ')[0]} failed with error: ${error === null || error === void 0 ? void 0 : error.message}`);
 | 
					            throw new Error(`Tar failed with error: ${error === null || error === void 0 ? void 0 : error.message}`);
 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
// List the contents of a tar
 | 
					 | 
				
			||||||
function listTar(archivePath, compressionMethod) {
 | 
					 | 
				
			||||||
    return __awaiter(this, void 0, void 0, function* () {
 | 
					 | 
				
			||||||
        const commands = yield getCommands(compressionMethod, 'list', archivePath);
 | 
					 | 
				
			||||||
        yield execCommands(commands);
 | 
					 | 
				
			||||||
    });
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
exports.listTar = listTar;
 | 
					exports.listTar = listTar;
 | 
				
			||||||
// Extract a tar
 | 
					 | 
				
			||||||
function extractTar(archivePath, compressionMethod) {
 | 
					function extractTar(archivePath, compressionMethod) {
 | 
				
			||||||
    return __awaiter(this, void 0, void 0, function* () {
 | 
					    return __awaiter(this, void 0, void 0, function* () {
 | 
				
			||||||
        // Create directory to extract tar into
 | 
					        // Create directory to extract tar into
 | 
				
			||||||
        const workingDirectory = getWorkingDirectory();
 | 
					        const workingDirectory = getWorkingDirectory();
 | 
				
			||||||
        yield io.mkdirP(workingDirectory);
 | 
					        yield io.mkdirP(workingDirectory);
 | 
				
			||||||
        const commands = yield getCommands(compressionMethod, 'extract', archivePath);
 | 
					        const args = yield getArgs(compressionMethod, 'extract', archivePath);
 | 
				
			||||||
        yield execCommands(commands);
 | 
					        try {
 | 
				
			||||||
 | 
					            yield exec_1.exec(args);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        catch (error) {
 | 
				
			||||||
 | 
					            throw new Error(`Tar failed with error: ${error === null || error === void 0 ? void 0 : error.message}`);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
exports.extractTar = extractTar;
 | 
					exports.extractTar = extractTar;
 | 
				
			||||||
// Create a tar
 | 
					 | 
				
			||||||
function createTar(archiveFolder, sourceDirectories, compressionMethod) {
 | 
					function createTar(archiveFolder, sourceDirectories, compressionMethod) {
 | 
				
			||||||
    return __awaiter(this, void 0, void 0, function* () {
 | 
					    return __awaiter(this, void 0, void 0, function* () {
 | 
				
			||||||
        // Write source directories to manifest.txt to avoid command length limits
 | 
					        // Write source directories to manifest.txt to avoid command length limits
 | 
				
			||||||
        fs_1.writeFileSync(path.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join('\n'));
 | 
					        fs_1.writeFileSync(path.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join('\n'));
 | 
				
			||||||
        const commands = yield getCommands(compressionMethod, 'create');
 | 
					        const args = yield getArgs(compressionMethod, 'create');
 | 
				
			||||||
        yield execCommands(commands, archiveFolder);
 | 
					        try {
 | 
				
			||||||
 | 
					            yield exec_1.exec(args, undefined, { cwd: archiveFolder });
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        catch (error) {
 | 
				
			||||||
 | 
					            throw new Error(`Tar failed with error: ${error === null || error === void 0 ? void 0 : error.message}`);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
exports.createTar = createTar;
 | 
					exports.createTar = createTar;
 | 
				
			||||||
@@ -47241,12 +47233,15 @@ function restoreCache(paths, primaryKey, restoreKeys, options) {
 | 
				
			|||||||
        let compressionMethod = yield utils.getCompressionMethod();
 | 
					        let compressionMethod = yield utils.getCompressionMethod();
 | 
				
			||||||
        let archivePath = '';
 | 
					        let archivePath = '';
 | 
				
			||||||
        try {
 | 
					        try {
 | 
				
			||||||
            // path are needed to compute version
 | 
					            try {
 | 
				
			||||||
            cacheEntry = yield cacheHttpClient.getCacheEntry(keys, paths, {
 | 
					                // path are needed to compute version
 | 
				
			||||||
                compressionMethod
 | 
					                cacheEntry = yield cacheHttpClient.getCacheEntry(keys, paths, {
 | 
				
			||||||
            });
 | 
					                    compressionMethod
 | 
				
			||||||
            if (!(cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.archiveLocation)) {
 | 
					                });
 | 
				
			||||||
                // This is to support the old cache entry created by gzip on windows.
 | 
					            }
 | 
				
			||||||
 | 
					            catch (error) {
 | 
				
			||||||
 | 
					                // This is to support the old cache entry created
 | 
				
			||||||
 | 
					                // by the old version of the cache action on windows.
 | 
				
			||||||
                if (process.platform === 'win32' &&
 | 
					                if (process.platform === 'win32' &&
 | 
				
			||||||
                    compressionMethod !== constants_1.CompressionMethod.Gzip) {
 | 
					                    compressionMethod !== constants_1.CompressionMethod.Gzip) {
 | 
				
			||||||
                    compressionMethod = constants_1.CompressionMethod.Gzip;
 | 
					                    compressionMethod = constants_1.CompressionMethod.Gzip;
 | 
				
			||||||
@@ -47254,15 +47249,17 @@ function restoreCache(paths, primaryKey, restoreKeys, options) {
 | 
				
			|||||||
                        compressionMethod
 | 
					                        compressionMethod
 | 
				
			||||||
                    });
 | 
					                    });
 | 
				
			||||||
                    if (!(cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.archiveLocation)) {
 | 
					                    if (!(cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.archiveLocation)) {
 | 
				
			||||||
                        return undefined;
 | 
					                        throw error;
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    core.debug("Couldn't find cache entry with zstd compression, falling back to gzip compression.");
 | 
					 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                else {
 | 
					                else {
 | 
				
			||||||
                    // Cache not found
 | 
					                    throw error;
 | 
				
			||||||
                    return undefined;
 | 
					 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					            if (!(cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.archiveLocation)) {
 | 
				
			||||||
 | 
					                // Cache not found
 | 
				
			||||||
 | 
					                return undefined;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
            archivePath = path.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod));
 | 
					            archivePath = path.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod));
 | 
				
			||||||
            core.debug(`Archive Path: ${archivePath}`);
 | 
					            core.debug(`Archive Path: ${archivePath}`);
 | 
				
			||||||
            // Download the cache from the cache entry
 | 
					            // Download the cache from the cache entry
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -317,7 +317,7 @@ After [deprecation](https://github.blog/changelog/2022-10-11-github-actions-depr
 | 
				
			|||||||
### Bash shell
 | 
					### Bash shell
 | 
				
			||||||
```yaml
 | 
					```yaml
 | 
				
			||||||
- name: Get npm cache directory
 | 
					- name: Get npm cache directory
 | 
				
			||||||
  id: npm-cache-dir
 | 
					  id: npm-cache
 | 
				
			||||||
  shell: bash
 | 
					  shell: bash
 | 
				
			||||||
  run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
 | 
					  run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
@@ -325,7 +325,7 @@ After [deprecation](https://github.blog/changelog/2022-10-11-github-actions-depr
 | 
				
			|||||||
### PWSH shell
 | 
					### PWSH shell
 | 
				
			||||||
```yaml
 | 
					```yaml
 | 
				
			||||||
- name: Get npm cache directory
 | 
					- name: Get npm cache directory
 | 
				
			||||||
  id: npm-cache-dir
 | 
					  id: npm-cache
 | 
				
			||||||
  shell: pwsh
 | 
					  shell: pwsh
 | 
				
			||||||
  run: echo "dir=$(npm config get cache)" >> ${env:GITHUB_OUTPUT}
 | 
					  run: echo "dir=$(npm config get cache)" >> ${env:GITHUB_OUTPUT}
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										18
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										18
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							@@ -1,15 +1,15 @@
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
  "name": "cache",
 | 
					  "name": "cache",
 | 
				
			||||||
  "version": "3.1.0-beta.3",
 | 
					  "version": "3.1.0-beta.2",
 | 
				
			||||||
  "lockfileVersion": 2,
 | 
					  "lockfileVersion": 2,
 | 
				
			||||||
  "requires": true,
 | 
					  "requires": true,
 | 
				
			||||||
  "packages": {
 | 
					  "packages": {
 | 
				
			||||||
    "": {
 | 
					    "": {
 | 
				
			||||||
      "name": "cache",
 | 
					      "name": "cache",
 | 
				
			||||||
      "version": "3.1.0-beta.3",
 | 
					      "version": "3.1.0-beta.2",
 | 
				
			||||||
      "license": "MIT",
 | 
					      "license": "MIT",
 | 
				
			||||||
      "dependencies": {
 | 
					      "dependencies": {
 | 
				
			||||||
        "@actions/cache": "3.1.0-beta.3",
 | 
					        "@actions/cache": "3.1.0-beta.2",
 | 
				
			||||||
        "@actions/core": "^1.10.0",
 | 
					        "@actions/core": "^1.10.0",
 | 
				
			||||||
        "@actions/exec": "^1.1.1",
 | 
					        "@actions/exec": "^1.1.1",
 | 
				
			||||||
        "@actions/io": "^1.1.2"
 | 
					        "@actions/io": "^1.1.2"
 | 
				
			||||||
@@ -36,9 +36,9 @@
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "node_modules/@actions/cache": {
 | 
					    "node_modules/@actions/cache": {
 | 
				
			||||||
      "version": "3.1.0-beta.3",
 | 
					      "version": "3.1.0-beta.2",
 | 
				
			||||||
      "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.1.0-beta.3.tgz",
 | 
					      "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.1.0-beta.2.tgz",
 | 
				
			||||||
      "integrity": "sha512-71S1vd0WKLbC2lAe04pCYqTLBjSa8gURtiqnVBCYAt8QVBjOfwa2D3ESf2m8K2xjUxman/Yimdp7CPJDyFnxZg==",
 | 
					      "integrity": "sha512-xt9NLWPCh5WU9Z5ITeGpT5Nza/57wMXeLsGuNVcRCIVpPuNTf3Puj82vjZZQw4rGqiCCs+n4+hnkTcE9BKw2sw==",
 | 
				
			||||||
      "dependencies": {
 | 
					      "dependencies": {
 | 
				
			||||||
        "@actions/core": "^1.10.0",
 | 
					        "@actions/core": "^1.10.0",
 | 
				
			||||||
        "@actions/exec": "^1.0.1",
 | 
					        "@actions/exec": "^1.0.1",
 | 
				
			||||||
@@ -9722,9 +9722,9 @@
 | 
				
			|||||||
  },
 | 
					  },
 | 
				
			||||||
  "dependencies": {
 | 
					  "dependencies": {
 | 
				
			||||||
    "@actions/cache": {
 | 
					    "@actions/cache": {
 | 
				
			||||||
      "version": "3.1.0-beta.3",
 | 
					      "version": "3.1.0-beta.2",
 | 
				
			||||||
      "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.1.0-beta.3.tgz",
 | 
					      "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.1.0-beta.2.tgz",
 | 
				
			||||||
      "integrity": "sha512-71S1vd0WKLbC2lAe04pCYqTLBjSa8gURtiqnVBCYAt8QVBjOfwa2D3ESf2m8K2xjUxman/Yimdp7CPJDyFnxZg==",
 | 
					      "integrity": "sha512-xt9NLWPCh5WU9Z5ITeGpT5Nza/57wMXeLsGuNVcRCIVpPuNTf3Puj82vjZZQw4rGqiCCs+n4+hnkTcE9BKw2sw==",
 | 
				
			||||||
      "requires": {
 | 
					      "requires": {
 | 
				
			||||||
        "@actions/core": "^1.10.0",
 | 
					        "@actions/core": "^1.10.0",
 | 
				
			||||||
        "@actions/exec": "^1.0.1",
 | 
					        "@actions/exec": "^1.0.1",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,6 @@
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
  "name": "cache",
 | 
					  "name": "cache",
 | 
				
			||||||
  "version": "3.1.0-beta.3",
 | 
					  "version": "3.1.0-beta.2",
 | 
				
			||||||
  "private": true,
 | 
					  "private": true,
 | 
				
			||||||
  "description": "Cache dependencies and build outputs",
 | 
					  "description": "Cache dependencies and build outputs",
 | 
				
			||||||
  "main": "dist/restore/index.js",
 | 
					  "main": "dist/restore/index.js",
 | 
				
			||||||
@@ -23,7 +23,7 @@
 | 
				
			|||||||
  "author": "GitHub",
 | 
					  "author": "GitHub",
 | 
				
			||||||
  "license": "MIT",
 | 
					  "license": "MIT",
 | 
				
			||||||
  "dependencies": {
 | 
					  "dependencies": {
 | 
				
			||||||
    "@actions/cache": "3.1.0-beta.3",
 | 
					    "@actions/cache": "3.1.0-beta.2",
 | 
				
			||||||
    "@actions/core": "^1.10.0",
 | 
					    "@actions/core": "^1.10.0",
 | 
				
			||||||
    "@actions/exec": "^1.1.1",
 | 
					    "@actions/exec": "^1.1.1",
 | 
				
			||||||
    "@actions/io": "^1.1.2"
 | 
					    "@actions/io": "^1.1.2"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -14,7 +14,7 @@ A cache today is immutable and cannot be updated. But some use cases require the
 | 
				
			|||||||
          restore-keys: |
 | 
					          restore-keys: |
 | 
				
			||||||
            primes-${{ runner.os }}
 | 
					            primes-${{ runner.os }}
 | 
				
			||||||
  ```          
 | 
					  ```          
 | 
				
			||||||
  Please note that this will create a new cache on every run and hence will consume the cache [quota](./README.md#cache-limits).
 | 
					  Please note that this will create a new cache on every run and hence will consume the cache [quota](#cache-limits).
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
## Use cache across feature branches
 | 
					## Use cache across feature branches
 | 
				
			||||||
Reusing cache across feature branches is not allowed today to provide cache [isolation](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#restrictions-for-accessing-a-cache). However if both feature branches are from the default branch, a good way to achieve this is to ensure that the default branch has a cache. This cache will then be consumable by both feature branches.
 | 
					Reusing cache across feature branches is not allowed today to provide cache [isolation](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#restrictions-for-accessing-a-cache). However if both feature branches are from the default branch, a good way to achieve this is to ensure that the default branch has a cache. This cache will then be consumable by both feature branches.
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user