Skip to content

Commit e3fb95a

Browse files
authored
Warn instead of fail for no-dependency-glob (#200)
Closes: #199
1 parent 2af22b5 commit e3fb95a

File tree

3 files changed

+7
-12
lines changed

3 files changed

+7
-12
lines changed

dist/save-cache/index.js

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

dist/setup/index.js

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

src/cache/restore-cache.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,11 @@ async function computeKeys(version: string): Promise<string> {
4343
);
4444
cacheDependencyPathHash += await hashFiles(cacheDependencyGlob, true);
4545
if (cacheDependencyPathHash === "-") {
46-
throw new Error(
47-
`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.`,
46+
core.warning(
47+
`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.`,
4848
);
4949
}
50-
} else {
51-
cacheDependencyPathHash += "no-dependency-glob";
50+
cacheDependencyPathHash = "-no-dependency-glob";
5251
}
5352
const suffix = cacheSuffix ? `-${cacheSuffix}` : "";
5453
const pythonVersion = await getPythonVersion();

0 commit comments

Comments
 (0)