mirror of
https://github.com/denoland/setup-deno.git
synced 2026-08-21 00:00:30 +02:00
feat: include a hash of deno.lock files in the cache key automatically (#98)
(cherry picked from commit 3169cf993b)
This commit is contained in:
+6
-1
@@ -20,6 +20,11 @@ function exit(message: string): never {
|
||||
process.exit();
|
||||
}
|
||||
|
||||
function isCachingEnabled() {
|
||||
return core.getInput("cache") === "true" ||
|
||||
core.getInput("cache-hash").length > 0;
|
||||
}
|
||||
|
||||
async function main() {
|
||||
try {
|
||||
const denoVersionFile = core.getInput("deno-version-file");
|
||||
@@ -57,7 +62,7 @@ async function main() {
|
||||
|
||||
core.info("Installation complete.");
|
||||
|
||||
if (core.getInput("cache") === "true") {
|
||||
if (isCachingEnabled()) {
|
||||
const { restoreCache } = await import("./cache.ts");
|
||||
await restoreCache(core.getInput("cache-hash"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user