Skip to content

Commit

Permalink
Warn instead of fail for no-dependency-glob (#200)
Browse files Browse the repository at this point in the history
Closes: #199
  • Loading branch information
eifinger authored Dec 20, 2024
1 parent 2af22b5 commit e3fb95a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
6 changes: 2 additions & 4 deletions dist/save-cache/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions dist/setup/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions src/cache/restore-cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit e3fb95a

Please sign in to comment.