Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cachePath as an output for easier access #1436

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Correct cachePath to be a direct output, not a state
  • Loading branch information
Ella Kramer authored and Ella Kramer committed Jul 19, 2024
commit 9806e2f37ffbb9b6e8d4f50d6142fd6b6e123f66
8 changes: 3 additions & 5 deletions dist/restore-only/index.js
Original file line number Diff line number Diff line change
@@ -174,7 +174,7 @@ function saveCache(paths, key, options, enableCrossOsArchive = false) {
checkPaths(paths);
checkKey(key);
const compressionMethod = yield utils.getCompressionMethod();
let cacheId = -1;
let cacheId = -1;
const cachePaths = yield utils.resolvePaths(paths);
core.debug('Cache Paths:');
core.debug(`${JSON.stringify(cachePaths)}`);
@@ -59337,7 +59337,6 @@ var State;
(function (State) {
State["CachePrimaryKey"] = "CACHE_KEY";
State["CacheMatchedKey"] = "CACHE_RESULT";
State["CachePath"] = "CACHE_PATH";
})(State = exports.State || (exports.State = {}));
var Events;
(function (Events) {
@@ -59411,7 +59410,7 @@ function restoreImpl(stateProvider, earlyExit) {
const restoreKeys = utils.getInputAsArray(constants_1.Inputs.RestoreKeys);

// Output the inputted path unchanged
stateProvider.setState(constants_1.State.CachePath, getInput(constants_1.Inputs.Path));
core.setOutput(constants_1.Outputs.CachePath, core.getInput(constants_1.Inputs.Path));

const cachePaths = utils.getInputAsArray(constants_1.Inputs.Path, {
required: true
@@ -59541,8 +59540,7 @@ class NullStateProvider extends StateProviderBase {
super(...arguments);
this.stateToOutputMap = new Map([
[constants_1.State.CacheMatchedKey, constants_1.Outputs.CacheMatchedKey],
[constants_1.State.CachePrimaryKey, constants_1.Outputs.CachePrimaryKey],
[constants_1.State.CachePath, constants_1.Outputs.CachePath]
[constants_1.State.CachePrimaryKey, constants_1.Outputs.CachePrimaryKey]
]);
this.setState = (key, value) => {
core.setOutput(this.stateToOutputMap.get(key), value);