mirror of
				https://gitea.com/actions/cache.git
				synced 2025-11-04 07:47:08 +00:00 
			
		
		
		
	Compare commits
	
		
			3 Commits
		
	
	
		
			v3.0.11
			...
			tiwarishub
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					938abf1ecf | ||
| 
						 | 
					e09283e3aa | ||
| 
						 | 
					3c1fd3e58a | 
							
								
								
									
										2
									
								
								.licenses/npm/@actions/cache.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2
									
								
								.licenses/npm/@actions/cache.dep.yml
									
									
									
										generated
									
									
									
								
							@@ -1,6 +1,6 @@
 | 
				
			|||||||
---
 | 
					---
 | 
				
			||||||
name: "@actions/cache"
 | 
					name: "@actions/cache"
 | 
				
			||||||
version: 3.0.5
 | 
					version: 3.0.4
 | 
				
			||||||
type: npm
 | 
					type: npm
 | 
				
			||||||
summary:
 | 
					summary:
 | 
				
			||||||
homepage:
 | 
					homepage:
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										2
									
								
								.licenses/npm/@actions/core.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2
									
								
								.licenses/npm/@actions/core.dep.yml
									
									
									
										generated
									
									
									
								
							@@ -1,6 +1,6 @@
 | 
				
			|||||||
---
 | 
					---
 | 
				
			||||||
name: "@actions/core"
 | 
					name: "@actions/core"
 | 
				
			||||||
version: 1.10.0
 | 
					version: 1.9.1
 | 
				
			||||||
type: npm
 | 
					type: npm
 | 
				
			||||||
summary: Actions core lib
 | 
					summary: Actions core lib
 | 
				
			||||||
homepage: https://github.com/actions/toolkit/tree/main/packages/core
 | 
					homepage: https://github.com/actions/toolkit/tree/main/packages/core
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -6,7 +6,7 @@ This action allows caching dependencies and build outputs to improve workflow ex
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
## Documentation
 | 
					## Documentation
 | 
				
			||||||
 | 
					
 | 
				
			||||||
See ["Caching dependencies to speed up workflows"](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows).
 | 
					See ["Caching dependencies to speed up workflows"](https://help.github.com/github/automating-your-workflow-with-github-actions/caching-dependencies-to-speed-up-workflows).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## What's New
 | 
					## What's New
 | 
				
			||||||
### v3
 | 
					### v3
 | 
				
			||||||
@@ -34,7 +34,7 @@ If you are using this inside a container, a POSIX-compliant `tar` needs to be in
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
* `path` - A list of files, directories, and wildcard patterns to cache and restore. See [`@actions/glob`](https://github.com/actions/toolkit/tree/main/packages/glob) for supported patterns.
 | 
					* `path` - A list of files, directories, and wildcard patterns to cache and restore. See [`@actions/glob`](https://github.com/actions/toolkit/tree/main/packages/glob) for supported patterns.
 | 
				
			||||||
* `key` - An explicit key for restoring and saving the cache
 | 
					* `key` - An explicit key for restoring and saving the cache
 | 
				
			||||||
* `restore-keys` - An ordered list of prefix-matched keys to use for restoring stale cache if no cache hit occurred for key. Note
 | 
					* `restore-keys` - An ordered list of keys to use for restoring stale cache if no cache hit occurred for key. Note
 | 
				
			||||||
`cache-hit` returns false in this case.
 | 
					`cache-hit` returns false in this case.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#### Environment Variables
 | 
					#### Environment Variables
 | 
				
			||||||
@@ -80,7 +80,7 @@ jobs:
 | 
				
			|||||||
      run: /primes.sh -d prime-numbers
 | 
					      run: /primes.sh -d prime-numbers
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
> Note: You must use the `cache` action in your workflow before you need to use the files that might be restored from the cache. If the provided `key` matches an existing cache, a new cache is not created and if the provided `key` doesn't match an existing cache, a new cache is automatically created provided the job completes successfully.
 | 
					> Note: You must use the `cache` action in your workflow before you need to use the files that might be restored from the cache. If the provided `key` doesn't match an existing cache, a new cache is automatically created if the job completes successfully.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Implementation Examples
 | 
					## Implementation Examples
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										13
									
								
								RELEASES.md
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								RELEASES.md
									
									
									
									
									
								
							@@ -28,15 +28,4 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
### 3.0.8
 | 
					### 3.0.8
 | 
				
			||||||
- Fix zstd not working for windows on gnu tar in issues [#888](https://github.com/actions/cache/issues/888) and [#891](https://github.com/actions/cache/issues/891).
 | 
					- Fix zstd not working for windows on gnu tar in issues [#888](https://github.com/actions/cache/issues/888) and [#891](https://github.com/actions/cache/issues/891).
 | 
				
			||||||
- Allowing users to provide a custom timeout as input for aborting download of a cache segment using an environment variable `SEGMENT_DOWNLOAD_TIMEOUT_MIN`. Default is 60 minutes.
 | 
					- Allowing users to provide a custom timeout as input for aborting download of a cache segment using an environment variable `SEGMENT_DOWNLOAD_TIMEOUT_MIN`. Default is 60 minutes.
 | 
				
			||||||
 | 
					 | 
				
			||||||
### 3.0.9
 | 
					 | 
				
			||||||
- Enhanced the warning message for cache unavailablity in case of GHES.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
### 3.0.10
 | 
					 | 
				
			||||||
- Fix a bug with sorting inputs.
 | 
					 | 
				
			||||||
- Update definition for restore-keys in README.md
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
### 3.0.11
 | 
					 | 
				
			||||||
- Update toolkit version to 3.0.5 to include `@actions/core@^1.10.0`
 | 
					 | 
				
			||||||
- Update `@actions/cache` to use updated `saveState` and `setOutput` functions from `@actions/core@^1.10.0`
 | 
					 | 
				
			||||||
@@ -215,6 +215,23 @@ test("getInputAsArray handles empty lines correctly", () => {
 | 
				
			|||||||
    expect(actionUtils.getInputAsArray("foo")).toEqual(["bar", "baz"]);
 | 
					    expect(actionUtils.getInputAsArray("foo")).toEqual(["bar", "baz"]);
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					test("getInputAsArray sorts files correctly", () => {
 | 
				
			||||||
 | 
					    testUtils.setInput(
 | 
				
			||||||
 | 
					        "foo",
 | 
				
			||||||
 | 
					        "bar\n!baz\nwaldo\nqux\nquux\ncorge\ngrault\ngarply"
 | 
				
			||||||
 | 
					    );
 | 
				
			||||||
 | 
					    expect(actionUtils.getInputAsArray("foo")).toEqual([
 | 
				
			||||||
 | 
					        "!baz",
 | 
				
			||||||
 | 
					        "bar",
 | 
				
			||||||
 | 
					        "corge",
 | 
				
			||||||
 | 
					        "garply",
 | 
				
			||||||
 | 
					        "grault",
 | 
				
			||||||
 | 
					        "quux",
 | 
				
			||||||
 | 
					        "qux",
 | 
				
			||||||
 | 
					        "waldo"
 | 
				
			||||||
 | 
					    ]);
 | 
				
			||||||
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test("getInputAsArray removes spaces after ! at the beginning", () => {
 | 
					test("getInputAsArray removes spaces after ! at the beginning", () => {
 | 
				
			||||||
    testUtils.setInput(
 | 
					    testUtils.setInput(
 | 
				
			||||||
        "foo",
 | 
					        "foo",
 | 
				
			||||||
@@ -223,11 +240,11 @@ test("getInputAsArray removes spaces after ! at the beginning", () => {
 | 
				
			|||||||
    expect(actionUtils.getInputAsArray("foo")).toEqual([
 | 
					    expect(actionUtils.getInputAsArray("foo")).toEqual([
 | 
				
			||||||
        "!bar",
 | 
					        "!bar",
 | 
				
			||||||
        "!baz",
 | 
					        "!baz",
 | 
				
			||||||
        "!qux",
 | 
					 | 
				
			||||||
        "!quux",
 | 
					        "!quux",
 | 
				
			||||||
 | 
					        "!qux",
 | 
				
			||||||
 | 
					        "!waldo",
 | 
				
			||||||
        "corge",
 | 
					        "corge",
 | 
				
			||||||
        "grault! garply",
 | 
					        "grault! garply"
 | 
				
			||||||
        "!waldo"
 | 
					 | 
				
			||||||
    ]);
 | 
					    ]);
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -147,7 +147,7 @@ test("restore with no key", async () => {
 | 
				
			|||||||
test("restore with too many keys should fail", async () => {
 | 
					test("restore with too many keys should fail", async () => {
 | 
				
			||||||
    const path = "node_modules";
 | 
					    const path = "node_modules";
 | 
				
			||||||
    const key = "node-test";
 | 
					    const key = "node-test";
 | 
				
			||||||
    const restoreKeys = [...Array(20).keys()].map(x => x.toString());
 | 
					    const restoreKeys = [...Array(20).keys()].map(x => x.toString()).sort();
 | 
				
			||||||
    testUtils.setInputs({
 | 
					    testUtils.setInputs({
 | 
				
			||||||
        path: path,
 | 
					        path: path,
 | 
				
			||||||
        key,
 | 
					        key,
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										60
									
								
								dist/restore/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										60
									
								
								dist/restore/index.js
									
									
									
									
										vendored
									
									
								
							@@ -2954,14 +2954,13 @@ var __importStar = (this && this.__importStar) || function (mod) {
 | 
				
			|||||||
    return result;
 | 
					    return result;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
Object.defineProperty(exports, "__esModule", { value: true });
 | 
					Object.defineProperty(exports, "__esModule", { value: true });
 | 
				
			||||||
exports.prepareKeyValueMessage = exports.issueFileCommand = void 0;
 | 
					exports.issueCommand = void 0;
 | 
				
			||||||
// We use any as a valid input type
 | 
					// We use any as a valid input type
 | 
				
			||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
 | 
					/* eslint-disable @typescript-eslint/no-explicit-any */
 | 
				
			||||||
const fs = __importStar(__webpack_require__(747));
 | 
					const fs = __importStar(__webpack_require__(747));
 | 
				
			||||||
const os = __importStar(__webpack_require__(87));
 | 
					const os = __importStar(__webpack_require__(87));
 | 
				
			||||||
const uuid_1 = __webpack_require__(25);
 | 
					 | 
				
			||||||
const utils_1 = __webpack_require__(82);
 | 
					const utils_1 = __webpack_require__(82);
 | 
				
			||||||
function issueFileCommand(command, message) {
 | 
					function issueCommand(command, message) {
 | 
				
			||||||
    const filePath = process.env[`GITHUB_${command}`];
 | 
					    const filePath = process.env[`GITHUB_${command}`];
 | 
				
			||||||
    if (!filePath) {
 | 
					    if (!filePath) {
 | 
				
			||||||
        throw new Error(`Unable to find environment variable for file command ${command}`);
 | 
					        throw new Error(`Unable to find environment variable for file command ${command}`);
 | 
				
			||||||
@@ -2973,22 +2972,7 @@ function issueFileCommand(command, message) {
 | 
				
			|||||||
        encoding: 'utf8'
 | 
					        encoding: 'utf8'
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
exports.issueFileCommand = issueFileCommand;
 | 
					exports.issueCommand = issueCommand;
 | 
				
			||||||
function prepareKeyValueMessage(key, value) {
 | 
					 | 
				
			||||||
    const delimiter = `ghadelimiter_${uuid_1.v4()}`;
 | 
					 | 
				
			||||||
    const convertedValue = utils_1.toCommandValue(value);
 | 
					 | 
				
			||||||
    // These should realistically never happen, but just in case someone finds a
 | 
					 | 
				
			||||||
    // way to exploit uuid generation let's not allow keys or values that contain
 | 
					 | 
				
			||||||
    // the delimiter.
 | 
					 | 
				
			||||||
    if (key.includes(delimiter)) {
 | 
					 | 
				
			||||||
        throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    if (convertedValue.includes(delimiter)) {
 | 
					 | 
				
			||||||
        throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
exports.prepareKeyValueMessage = prepareKeyValueMessage;
 | 
					 | 
				
			||||||
//# sourceMappingURL=file-command.js.map
 | 
					//# sourceMappingURL=file-command.js.map
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/***/ }),
 | 
					/***/ }),
 | 
				
			||||||
@@ -38453,7 +38437,8 @@ function getInputAsArray(name, options) {
 | 
				
			|||||||
        .getInput(name, options)
 | 
					        .getInput(name, options)
 | 
				
			||||||
        .split("\n")
 | 
					        .split("\n")
 | 
				
			||||||
        .map(s => s.replace(/^!\s+/, "!").trim())
 | 
					        .map(s => s.replace(/^!\s+/, "!").trim())
 | 
				
			||||||
        .filter(x => x !== "");
 | 
					        .filter(x => x !== "")
 | 
				
			||||||
 | 
					        .sort();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
exports.getInputAsArray = getInputAsArray;
 | 
					exports.getInputAsArray = getInputAsArray;
 | 
				
			||||||
function getInputAsInt(name, options) {
 | 
					function getInputAsInt(name, options) {
 | 
				
			||||||
@@ -40567,6 +40552,7 @@ const file_command_1 = __webpack_require__(102);
 | 
				
			|||||||
const utils_1 = __webpack_require__(82);
 | 
					const utils_1 = __webpack_require__(82);
 | 
				
			||||||
const os = __importStar(__webpack_require__(87));
 | 
					const os = __importStar(__webpack_require__(87));
 | 
				
			||||||
const path = __importStar(__webpack_require__(622));
 | 
					const path = __importStar(__webpack_require__(622));
 | 
				
			||||||
 | 
					const uuid_1 = __webpack_require__(25);
 | 
				
			||||||
const oidc_utils_1 = __webpack_require__(742);
 | 
					const oidc_utils_1 = __webpack_require__(742);
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * The code to exit an action
 | 
					 * The code to exit an action
 | 
				
			||||||
@@ -40596,9 +40582,20 @@ function exportVariable(name, val) {
 | 
				
			|||||||
    process.env[name] = convertedVal;
 | 
					    process.env[name] = convertedVal;
 | 
				
			||||||
    const filePath = process.env['GITHUB_ENV'] || '';
 | 
					    const filePath = process.env['GITHUB_ENV'] || '';
 | 
				
			||||||
    if (filePath) {
 | 
					    if (filePath) {
 | 
				
			||||||
        return file_command_1.issueFileCommand('ENV', file_command_1.prepareKeyValueMessage(name, val));
 | 
					        const delimiter = `ghadelimiter_${uuid_1.v4()}`;
 | 
				
			||||||
 | 
					        // These should realistically never happen, but just in case someone finds a way to exploit uuid generation let's not allow keys or values that contain the delimiter.
 | 
				
			||||||
 | 
					        if (name.includes(delimiter)) {
 | 
				
			||||||
 | 
					            throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        if (convertedVal.includes(delimiter)) {
 | 
				
			||||||
 | 
					            throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;
 | 
				
			||||||
 | 
					        file_command_1.issueCommand('ENV', commandValue);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    else {
 | 
				
			||||||
 | 
					        command_1.issueCommand('set-env', { name }, convertedVal);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    command_1.issueCommand('set-env', { name }, convertedVal);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
exports.exportVariable = exportVariable;
 | 
					exports.exportVariable = exportVariable;
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
@@ -40616,7 +40613,7 @@ exports.setSecret = setSecret;
 | 
				
			|||||||
function addPath(inputPath) {
 | 
					function addPath(inputPath) {
 | 
				
			||||||
    const filePath = process.env['GITHUB_PATH'] || '';
 | 
					    const filePath = process.env['GITHUB_PATH'] || '';
 | 
				
			||||||
    if (filePath) {
 | 
					    if (filePath) {
 | 
				
			||||||
        file_command_1.issueFileCommand('PATH', inputPath);
 | 
					        file_command_1.issueCommand('PATH', inputPath);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    else {
 | 
					    else {
 | 
				
			||||||
        command_1.issueCommand('add-path', {}, inputPath);
 | 
					        command_1.issueCommand('add-path', {}, inputPath);
 | 
				
			||||||
@@ -40656,10 +40653,7 @@ function getMultilineInput(name, options) {
 | 
				
			|||||||
    const inputs = getInput(name, options)
 | 
					    const inputs = getInput(name, options)
 | 
				
			||||||
        .split('\n')
 | 
					        .split('\n')
 | 
				
			||||||
        .filter(x => x !== '');
 | 
					        .filter(x => x !== '');
 | 
				
			||||||
    if (options && options.trimWhitespace === false) {
 | 
					    return inputs;
 | 
				
			||||||
        return inputs;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    return inputs.map(input => input.trim());
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
exports.getMultilineInput = getMultilineInput;
 | 
					exports.getMultilineInput = getMultilineInput;
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
@@ -40692,12 +40686,8 @@ exports.getBooleanInput = getBooleanInput;
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
 | 
					// eslint-disable-next-line @typescript-eslint/no-explicit-any
 | 
				
			||||||
function setOutput(name, value) {
 | 
					function setOutput(name, value) {
 | 
				
			||||||
    const filePath = process.env['GITHUB_OUTPUT'] || '';
 | 
					 | 
				
			||||||
    if (filePath) {
 | 
					 | 
				
			||||||
        return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value));
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    process.stdout.write(os.EOL);
 | 
					    process.stdout.write(os.EOL);
 | 
				
			||||||
    command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value));
 | 
					    command_1.issueCommand('set-output', { name }, value);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
exports.setOutput = setOutput;
 | 
					exports.setOutput = setOutput;
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
@@ -40826,11 +40816,7 @@ exports.group = group;
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
 | 
					// eslint-disable-next-line @typescript-eslint/no-explicit-any
 | 
				
			||||||
function saveState(name, value) {
 | 
					function saveState(name, value) {
 | 
				
			||||||
    const filePath = process.env['GITHUB_STATE'] || '';
 | 
					    command_1.issueCommand('save-state', { name }, value);
 | 
				
			||||||
    if (filePath) {
 | 
					 | 
				
			||||||
        return file_command_1.issueFileCommand('STATE', file_command_1.prepareKeyValueMessage(name, value));
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    command_1.issueCommand('save-state', { name }, utils_1.toCommandValue(value));
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
exports.saveState = saveState;
 | 
					exports.saveState = saveState;
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										60
									
								
								dist/save/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										60
									
								
								dist/save/index.js
									
									
									
									
										vendored
									
									
								
							@@ -2954,14 +2954,13 @@ var __importStar = (this && this.__importStar) || function (mod) {
 | 
				
			|||||||
    return result;
 | 
					    return result;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
Object.defineProperty(exports, "__esModule", { value: true });
 | 
					Object.defineProperty(exports, "__esModule", { value: true });
 | 
				
			||||||
exports.prepareKeyValueMessage = exports.issueFileCommand = void 0;
 | 
					exports.issueCommand = void 0;
 | 
				
			||||||
// We use any as a valid input type
 | 
					// We use any as a valid input type
 | 
				
			||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
 | 
					/* eslint-disable @typescript-eslint/no-explicit-any */
 | 
				
			||||||
const fs = __importStar(__webpack_require__(747));
 | 
					const fs = __importStar(__webpack_require__(747));
 | 
				
			||||||
const os = __importStar(__webpack_require__(87));
 | 
					const os = __importStar(__webpack_require__(87));
 | 
				
			||||||
const uuid_1 = __webpack_require__(25);
 | 
					 | 
				
			||||||
const utils_1 = __webpack_require__(82);
 | 
					const utils_1 = __webpack_require__(82);
 | 
				
			||||||
function issueFileCommand(command, message) {
 | 
					function issueCommand(command, message) {
 | 
				
			||||||
    const filePath = process.env[`GITHUB_${command}`];
 | 
					    const filePath = process.env[`GITHUB_${command}`];
 | 
				
			||||||
    if (!filePath) {
 | 
					    if (!filePath) {
 | 
				
			||||||
        throw new Error(`Unable to find environment variable for file command ${command}`);
 | 
					        throw new Error(`Unable to find environment variable for file command ${command}`);
 | 
				
			||||||
@@ -2973,22 +2972,7 @@ function issueFileCommand(command, message) {
 | 
				
			|||||||
        encoding: 'utf8'
 | 
					        encoding: 'utf8'
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
exports.issueFileCommand = issueFileCommand;
 | 
					exports.issueCommand = issueCommand;
 | 
				
			||||||
function prepareKeyValueMessage(key, value) {
 | 
					 | 
				
			||||||
    const delimiter = `ghadelimiter_${uuid_1.v4()}`;
 | 
					 | 
				
			||||||
    const convertedValue = utils_1.toCommandValue(value);
 | 
					 | 
				
			||||||
    // These should realistically never happen, but just in case someone finds a
 | 
					 | 
				
			||||||
    // way to exploit uuid generation let's not allow keys or values that contain
 | 
					 | 
				
			||||||
    // the delimiter.
 | 
					 | 
				
			||||||
    if (key.includes(delimiter)) {
 | 
					 | 
				
			||||||
        throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    if (convertedValue.includes(delimiter)) {
 | 
					 | 
				
			||||||
        throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
exports.prepareKeyValueMessage = prepareKeyValueMessage;
 | 
					 | 
				
			||||||
//# sourceMappingURL=file-command.js.map
 | 
					//# sourceMappingURL=file-command.js.map
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/***/ }),
 | 
					/***/ }),
 | 
				
			||||||
@@ -38453,7 +38437,8 @@ function getInputAsArray(name, options) {
 | 
				
			|||||||
        .getInput(name, options)
 | 
					        .getInput(name, options)
 | 
				
			||||||
        .split("\n")
 | 
					        .split("\n")
 | 
				
			||||||
        .map(s => s.replace(/^!\s+/, "!").trim())
 | 
					        .map(s => s.replace(/^!\s+/, "!").trim())
 | 
				
			||||||
        .filter(x => x !== "");
 | 
					        .filter(x => x !== "")
 | 
				
			||||||
 | 
					        .sort();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
exports.getInputAsArray = getInputAsArray;
 | 
					exports.getInputAsArray = getInputAsArray;
 | 
				
			||||||
function getInputAsInt(name, options) {
 | 
					function getInputAsInt(name, options) {
 | 
				
			||||||
@@ -40567,6 +40552,7 @@ const file_command_1 = __webpack_require__(102);
 | 
				
			|||||||
const utils_1 = __webpack_require__(82);
 | 
					const utils_1 = __webpack_require__(82);
 | 
				
			||||||
const os = __importStar(__webpack_require__(87));
 | 
					const os = __importStar(__webpack_require__(87));
 | 
				
			||||||
const path = __importStar(__webpack_require__(622));
 | 
					const path = __importStar(__webpack_require__(622));
 | 
				
			||||||
 | 
					const uuid_1 = __webpack_require__(25);
 | 
				
			||||||
const oidc_utils_1 = __webpack_require__(742);
 | 
					const oidc_utils_1 = __webpack_require__(742);
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * The code to exit an action
 | 
					 * The code to exit an action
 | 
				
			||||||
@@ -40596,9 +40582,20 @@ function exportVariable(name, val) {
 | 
				
			|||||||
    process.env[name] = convertedVal;
 | 
					    process.env[name] = convertedVal;
 | 
				
			||||||
    const filePath = process.env['GITHUB_ENV'] || '';
 | 
					    const filePath = process.env['GITHUB_ENV'] || '';
 | 
				
			||||||
    if (filePath) {
 | 
					    if (filePath) {
 | 
				
			||||||
        return file_command_1.issueFileCommand('ENV', file_command_1.prepareKeyValueMessage(name, val));
 | 
					        const delimiter = `ghadelimiter_${uuid_1.v4()}`;
 | 
				
			||||||
 | 
					        // These should realistically never happen, but just in case someone finds a way to exploit uuid generation let's not allow keys or values that contain the delimiter.
 | 
				
			||||||
 | 
					        if (name.includes(delimiter)) {
 | 
				
			||||||
 | 
					            throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        if (convertedVal.includes(delimiter)) {
 | 
				
			||||||
 | 
					            throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;
 | 
				
			||||||
 | 
					        file_command_1.issueCommand('ENV', commandValue);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    else {
 | 
				
			||||||
 | 
					        command_1.issueCommand('set-env', { name }, convertedVal);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    command_1.issueCommand('set-env', { name }, convertedVal);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
exports.exportVariable = exportVariable;
 | 
					exports.exportVariable = exportVariable;
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
@@ -40616,7 +40613,7 @@ exports.setSecret = setSecret;
 | 
				
			|||||||
function addPath(inputPath) {
 | 
					function addPath(inputPath) {
 | 
				
			||||||
    const filePath = process.env['GITHUB_PATH'] || '';
 | 
					    const filePath = process.env['GITHUB_PATH'] || '';
 | 
				
			||||||
    if (filePath) {
 | 
					    if (filePath) {
 | 
				
			||||||
        file_command_1.issueFileCommand('PATH', inputPath);
 | 
					        file_command_1.issueCommand('PATH', inputPath);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    else {
 | 
					    else {
 | 
				
			||||||
        command_1.issueCommand('add-path', {}, inputPath);
 | 
					        command_1.issueCommand('add-path', {}, inputPath);
 | 
				
			||||||
@@ -40656,10 +40653,7 @@ function getMultilineInput(name, options) {
 | 
				
			|||||||
    const inputs = getInput(name, options)
 | 
					    const inputs = getInput(name, options)
 | 
				
			||||||
        .split('\n')
 | 
					        .split('\n')
 | 
				
			||||||
        .filter(x => x !== '');
 | 
					        .filter(x => x !== '');
 | 
				
			||||||
    if (options && options.trimWhitespace === false) {
 | 
					    return inputs;
 | 
				
			||||||
        return inputs;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    return inputs.map(input => input.trim());
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
exports.getMultilineInput = getMultilineInput;
 | 
					exports.getMultilineInput = getMultilineInput;
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
@@ -40692,12 +40686,8 @@ exports.getBooleanInput = getBooleanInput;
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
 | 
					// eslint-disable-next-line @typescript-eslint/no-explicit-any
 | 
				
			||||||
function setOutput(name, value) {
 | 
					function setOutput(name, value) {
 | 
				
			||||||
    const filePath = process.env['GITHUB_OUTPUT'] || '';
 | 
					 | 
				
			||||||
    if (filePath) {
 | 
					 | 
				
			||||||
        return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value));
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    process.stdout.write(os.EOL);
 | 
					    process.stdout.write(os.EOL);
 | 
				
			||||||
    command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value));
 | 
					    command_1.issueCommand('set-output', { name }, value);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
exports.setOutput = setOutput;
 | 
					exports.setOutput = setOutput;
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
@@ -40826,11 +40816,7 @@ exports.group = group;
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
 | 
					// eslint-disable-next-line @typescript-eslint/no-explicit-any
 | 
				
			||||||
function saveState(name, value) {
 | 
					function saveState(name, value) {
 | 
				
			||||||
    const filePath = process.env['GITHUB_STATE'] || '';
 | 
					    command_1.issueCommand('save-state', { name }, value);
 | 
				
			||||||
    if (filePath) {
 | 
					 | 
				
			||||||
        return file_command_1.issueFileCommand('STATE', file_command_1.prepareKeyValueMessage(name, value));
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    command_1.issueCommand('save-state', { name }, utils_1.toCommandValue(value));
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
exports.saveState = saveState;
 | 
					exports.saveState = saveState;
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -332,7 +332,7 @@ If using `npm config` to retrieve the cache directory, ensure you run [actions/s
 | 
				
			|||||||
- name: restore lerna
 | 
					- name: restore lerna
 | 
				
			||||||
  uses: actions/cache@v3
 | 
					  uses: actions/cache@v3
 | 
				
			||||||
  with:
 | 
					  with:
 | 
				
			||||||
    path: '**/node_modules'
 | 
					    path: **/node_modules
 | 
				
			||||||
    key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
 | 
					    key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										36
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										36
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							@@ -1,16 +1,16 @@
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
  "name": "cache",
 | 
					  "name": "cache",
 | 
				
			||||||
  "version": "3.0.11",
 | 
					  "version": "3.0.8",
 | 
				
			||||||
  "lockfileVersion": 2,
 | 
					  "lockfileVersion": 2,
 | 
				
			||||||
  "requires": true,
 | 
					  "requires": true,
 | 
				
			||||||
  "packages": {
 | 
					  "packages": {
 | 
				
			||||||
    "": {
 | 
					    "": {
 | 
				
			||||||
      "name": "cache",
 | 
					      "name": "cache",
 | 
				
			||||||
      "version": "3.0.11",
 | 
					      "version": "3.0.8",
 | 
				
			||||||
      "license": "MIT",
 | 
					      "license": "MIT",
 | 
				
			||||||
      "dependencies": {
 | 
					      "dependencies": {
 | 
				
			||||||
        "@actions/cache": "^3.0.5",
 | 
					        "@actions/cache": "^3.0.4",
 | 
				
			||||||
        "@actions/core": "^1.10.0",
 | 
					        "@actions/core": "^1.9.1",
 | 
				
			||||||
        "@actions/exec": "^1.1.1",
 | 
					        "@actions/exec": "^1.1.1",
 | 
				
			||||||
        "@actions/io": "^1.1.2"
 | 
					        "@actions/io": "^1.1.2"
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
@@ -36,11 +36,11 @@
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "node_modules/@actions/cache": {
 | 
					    "node_modules/@actions/cache": {
 | 
				
			||||||
      "version": "3.0.5",
 | 
					      "version": "3.0.4",
 | 
				
			||||||
      "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.0.5.tgz",
 | 
					      "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.0.4.tgz",
 | 
				
			||||||
      "integrity": "sha512-0WpPmwnRPkn5k5ASmjoX8bY8NrZEPTwN+64nGYJmR/bHjEVgC8svdf5K956wi67tNJBGJky2+UfvNbUOtHmMHg==",
 | 
					      "integrity": "sha512-9RwVL8/ISJoYWFNH1wR/C26E+M3HDkGPWmbFJMMCKwTkjbNZJreMT4XaR/EB1bheIvN4PREQxEQQVJ18IPnf/Q==",
 | 
				
			||||||
      "dependencies": {
 | 
					      "dependencies": {
 | 
				
			||||||
        "@actions/core": "^1.10.0",
 | 
					        "@actions/core": "^1.2.6",
 | 
				
			||||||
        "@actions/exec": "^1.0.1",
 | 
					        "@actions/exec": "^1.0.1",
 | 
				
			||||||
        "@actions/glob": "^0.1.0",
 | 
					        "@actions/glob": "^0.1.0",
 | 
				
			||||||
        "@actions/http-client": "^2.0.1",
 | 
					        "@actions/http-client": "^2.0.1",
 | 
				
			||||||
@@ -52,9 +52,9 @@
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "node_modules/@actions/core": {
 | 
					    "node_modules/@actions/core": {
 | 
				
			||||||
      "version": "1.10.0",
 | 
					      "version": "1.9.1",
 | 
				
			||||||
      "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz",
 | 
					      "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.9.1.tgz",
 | 
				
			||||||
      "integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==",
 | 
					      "integrity": "sha512-5ad+U2YGrmmiw6du20AQW5XuWo7UKN2052FjSV7MX+Wfjf8sCqcsZe62NfgHys4QI4/Y+vQvLKYL8jWtA1ZBTA==",
 | 
				
			||||||
      "dependencies": {
 | 
					      "dependencies": {
 | 
				
			||||||
        "@actions/http-client": "^2.0.1",
 | 
					        "@actions/http-client": "^2.0.1",
 | 
				
			||||||
        "uuid": "^8.3.2"
 | 
					        "uuid": "^8.3.2"
 | 
				
			||||||
@@ -9534,11 +9534,11 @@
 | 
				
			|||||||
  },
 | 
					  },
 | 
				
			||||||
  "dependencies": {
 | 
					  "dependencies": {
 | 
				
			||||||
    "@actions/cache": {
 | 
					    "@actions/cache": {
 | 
				
			||||||
      "version": "3.0.5",
 | 
					      "version": "3.0.4",
 | 
				
			||||||
      "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.0.5.tgz",
 | 
					      "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.0.4.tgz",
 | 
				
			||||||
      "integrity": "sha512-0WpPmwnRPkn5k5ASmjoX8bY8NrZEPTwN+64nGYJmR/bHjEVgC8svdf5K956wi67tNJBGJky2+UfvNbUOtHmMHg==",
 | 
					      "integrity": "sha512-9RwVL8/ISJoYWFNH1wR/C26E+M3HDkGPWmbFJMMCKwTkjbNZJreMT4XaR/EB1bheIvN4PREQxEQQVJ18IPnf/Q==",
 | 
				
			||||||
      "requires": {
 | 
					      "requires": {
 | 
				
			||||||
        "@actions/core": "^1.10.0",
 | 
					        "@actions/core": "^1.2.6",
 | 
				
			||||||
        "@actions/exec": "^1.0.1",
 | 
					        "@actions/exec": "^1.0.1",
 | 
				
			||||||
        "@actions/glob": "^0.1.0",
 | 
					        "@actions/glob": "^0.1.0",
 | 
				
			||||||
        "@actions/http-client": "^2.0.1",
 | 
					        "@actions/http-client": "^2.0.1",
 | 
				
			||||||
@@ -9550,9 +9550,9 @@
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "@actions/core": {
 | 
					    "@actions/core": {
 | 
				
			||||||
      "version": "1.10.0",
 | 
					      "version": "1.9.1",
 | 
				
			||||||
      "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz",
 | 
					      "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.9.1.tgz",
 | 
				
			||||||
      "integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==",
 | 
					      "integrity": "sha512-5ad+U2YGrmmiw6du20AQW5XuWo7UKN2052FjSV7MX+Wfjf8sCqcsZe62NfgHys4QI4/Y+vQvLKYL8jWtA1ZBTA==",
 | 
				
			||||||
      "requires": {
 | 
					      "requires": {
 | 
				
			||||||
        "@actions/http-client": "^2.0.1",
 | 
					        "@actions/http-client": "^2.0.1",
 | 
				
			||||||
        "uuid": "^8.3.2"
 | 
					        "uuid": "^8.3.2"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,6 @@
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
  "name": "cache",
 | 
					  "name": "cache",
 | 
				
			||||||
  "version": "3.0.11",
 | 
					  "version": "3.0.8",
 | 
				
			||||||
  "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,8 +23,8 @@
 | 
				
			|||||||
  "author": "GitHub",
 | 
					  "author": "GitHub",
 | 
				
			||||||
  "license": "MIT",
 | 
					  "license": "MIT",
 | 
				
			||||||
  "dependencies": {
 | 
					  "dependencies": {
 | 
				
			||||||
    "@actions/cache": "^3.0.5",
 | 
					    "@actions/cache": "^3.0.4",
 | 
				
			||||||
    "@actions/core": "^1.10.0",
 | 
					    "@actions/core": "^1.9.1",
 | 
				
			||||||
    "@actions/exec": "^1.1.1",
 | 
					    "@actions/exec": "^1.1.1",
 | 
				
			||||||
    "@actions/io": "^1.1.2"
 | 
					    "@actions/io": "^1.1.2"
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
@@ -48,4 +48,4 @@
 | 
				
			|||||||
    "ts-jest": "^28.0.2",
 | 
					    "ts-jest": "^28.0.2",
 | 
				
			||||||
    "typescript": "^4.6.4"
 | 
					    "typescript": "^4.6.4"
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -62,7 +62,8 @@ export function getInputAsArray(
 | 
				
			|||||||
        .getInput(name, options)
 | 
					        .getInput(name, options)
 | 
				
			||||||
        .split("\n")
 | 
					        .split("\n")
 | 
				
			||||||
        .map(s => s.replace(/^!\s+/, "!").trim())
 | 
					        .map(s => s.replace(/^!\s+/, "!").trim())
 | 
				
			||||||
        .filter(x => x !== "");
 | 
					        .filter(x => x !== "")
 | 
				
			||||||
 | 
					        .sort();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export function getInputAsInt(
 | 
					export function getInputAsInt(
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user