Warn instead of fail for no-dependency-glob (#200)

Closes: #199
This commit is contained in:
Kevin Stillhammer 2024-12-20 11:32:52 +01:00 committed by GitHub
parent 2af22b5b2d
commit e3fb95a689
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 12 deletions

View file

@ -43,12 +43,11 @@ async function computeKeys(version: string): Promise<string> {
);
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();