Skip to content

Commit 7a06e98

Browse files
committed
build
1 parent 735686b commit 7a06e98

File tree

4 files changed

+25
-9
lines changed

4 files changed

+25
-9
lines changed

dist/cache-save/index.js

+8
Original file line numberDiff line numberDiff line change
@@ -73648,6 +73648,7 @@ const promises_namespaceObject = require("fs/promises");
7364873648
const State = {
7364973649
CachePrimaryKey: "primary_key",
7365073650
CacheMatchedKey: "matched_key",
73651+
CacheEnabledKey: "cache_enabled",
7365173652
};
7365273653

7365373654
async function getCacheDirectory() {
@@ -73723,6 +73724,13 @@ async function getScarbLockPath(scarbLockPath) {
7372373724

7372473725

7372573726
async function saveCache() {
73727+
const enableCache = JSON.parse(core.getState(State.CacheEnabledKey));
73728+
73729+
if (!enableCache) {
73730+
core.info(`Caching disabled, not saving cache.`);
73731+
return;
73732+
}
73733+
7372673734
try {
7372773735
const primaryKey = core.getState(State.CachePrimaryKey);
7372873736
const matchedKey = core.getState(State.CacheMatchedKey);

dist/cache-save/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/setup/index.js

+15-7
Original file line numberDiff line numberDiff line change
@@ -74745,6 +74745,7 @@ var glob = __nccwpck_require__(8090);
7474574745
const State = {
7474674746
CachePrimaryKey: "primary_key",
7474774747
CacheMatchedKey: "matched_key",
74748+
CacheEnabledKey: "cache_enabled",
7474874749
};
7474974750

7475074751
async function getCacheDirectory() {
@@ -74849,11 +74850,13 @@ async function restoreCache(scarbLockPath) {
7484974850

7485074851

7485174852

74853+
7485274854
async function main() {
7485374855
try {
7485474856
const scarbVersionInput = core.getInput("scarb-version");
7485574857
const toolVersionsPathInput = core.getInput("tool-versions");
7485674858
const scarbLockPathInput = core.getInput("scarb-lock");
74859+
const enableCache = core.getBooleanInput("cache");
7485774860

7485874861
const { repo: scarbRepo, version: scarbVersion } = await determineVersion(
7485974862
scarbVersionInput,
@@ -74887,13 +74890,18 @@ async function main() {
7488774890

7488874891
core.setOutput("scarb-version", await getFullVersionFromScarb());
7488974892

74890-
await restoreCache(scarbLockPathInput).catch((e) => {
74891-
core.error(
74892-
`There was an error when restoring cache: ${
74893-
e instanceof Error ? e.message : e
74894-
}`,
74895-
);
74896-
});
74893+
core.saveState(State.CacheEnabledKey, enableCache);
74894+
if (enableCache) {
74895+
await restoreCache(scarbLockPathInput).catch((e) => {
74896+
core.error(
74897+
`There was an error when restoring cache: ${
74898+
e instanceof Error ? e.message : e
74899+
}`,
74900+
);
74901+
});
74902+
} else {
74903+
core.info(`Caching disabled, not restoring cache.`);
74904+
}
7489774905
} catch (e) {
7489874906
core.setFailed(e);
7489974907
}

dist/setup/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)