diff --git a/dist/save-cache/index.js b/dist/save-cache/index.js index aba2bdd..7e7b7b7 100644 --- a/dist/save-cache/index.js +++ b/dist/save-cache/index.js @@ -91490,11 +91490,9 @@ function computeKeys(version) { core.info(`Searching files using cache dependency glob: ${inputs_1.cacheDependencyGlob.split("\n").join(",")}`); cacheDependencyPathHash += yield (0, hash_files_1.hashFiles)(inputs_1.cacheDependencyGlob, true); if (cacheDependencyPathHash === "-") { - throw new Error(`No file matched to [${inputs_1.cacheDependencyGlob.split("\n").join(",")}], make sure you have checked out the target repository and configured the cache-dependency-glob input correctly.`); + core.warning(`No file matched to [${inputs_1.cacheDependencyGlob.split("\n").join(",")}]. The cache will never get invalidated. Make sure you have checked out the target repository and configured the cache-dependency-glob input correctly.`); } - } - else { - cacheDependencyPathHash += "no-dependency-glob"; + cacheDependencyPathHash = "-no-dependency-glob"; } const suffix = inputs_1.cacheSuffix ? `-${inputs_1.cacheSuffix}` : ""; const pythonVersion = yield getPythonVersion(); diff --git a/dist/setup/index.js b/dist/setup/index.js index 9d8c0e9..e9f1bff 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -96573,11 +96573,9 @@ function computeKeys(version) { core.info(`Searching files using cache dependency glob: ${inputs_1.cacheDependencyGlob.split("\n").join(",")}`); cacheDependencyPathHash += yield (0, hash_files_1.hashFiles)(inputs_1.cacheDependencyGlob, true); if (cacheDependencyPathHash === "-") { - throw new Error(`No file matched to [${inputs_1.cacheDependencyGlob.split("\n").join(",")}], make sure you have checked out the target repository and configured the cache-dependency-glob input correctly.`); + core.warning(`No file matched to [${inputs_1.cacheDependencyGlob.split("\n").join(",")}]. The cache will never get invalidated. Make sure you have checked out the target repository and configured the cache-dependency-glob input correctly.`); } - } - else { - cacheDependencyPathHash += "no-dependency-glob"; + cacheDependencyPathHash = "-no-dependency-glob"; } const suffix = inputs_1.cacheSuffix ? `-${inputs_1.cacheSuffix}` : ""; const pythonVersion = yield getPythonVersion(); diff --git a/src/cache/restore-cache.ts b/src/cache/restore-cache.ts index 90631b9..82572a0 100644 --- a/src/cache/restore-cache.ts +++ b/src/cache/restore-cache.ts @@ -43,12 +43,11 @@ async function computeKeys(version: string): Promise { ); cacheDependencyPathHash += await hashFiles(cacheDependencyGlob, true); if (cacheDependencyPathHash === "-") { - throw new Error( - `No file matched to [${cacheDependencyGlob.split("\n").join(",")}], make sure you have checked out the target repository and configured the cache-dependency-glob input correctly.`, + core.warning( + `No file matched to [${cacheDependencyGlob.split("\n").join(",")}]. The cache will never get invalidated. Make sure you have checked out the target repository and configured the cache-dependency-glob input correctly.`, ); } - } else { - cacheDependencyPathHash += "no-dependency-glob"; + cacheDependencyPathHash = "-no-dependency-glob"; } const suffix = cacheSuffix ? `-${cacheSuffix}` : ""; const pythonVersion = await getPythonVersion();