Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't follow symlinks when hashing cache files #10

Merged
merged 1 commit into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion dist/post/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -95859,7 +95859,12 @@ async function saveCache(cacheConfig) {
try {
core.startGroup(`Save cache for ${cacheConfig.name}`)
const paths = cacheConfig.paths
const hash = await glob.hashFiles(cacheConfig.files.join('\n'))
const hash = await glob.hashFiles(
cacheConfig.files.join('\n'),
undefined,
// We don't want to follow symlinks as it's extremely slow on macOS.
{ followSymbolicLinks: false }
)
const key = `${config.baseCacheKey}-${cacheConfig.name}-${hash}`
console.log(`Attempting to save ${paths} cache to ${key}`)
await cache.saveCache(paths, key)
Expand Down
2 changes: 1 addition & 1 deletion dist/post/index.js.map

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion post.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,12 @@ async function saveCache(cacheConfig) {
try {
core.startGroup(`Save cache for ${cacheConfig.name}`)
const paths = cacheConfig.paths
const hash = await glob.hashFiles(cacheConfig.files.join('\n'))
const hash = await glob.hashFiles(
cacheConfig.files.join('\n'),
undefined,
// We don't want to follow symlinks as it's extremely slow on macOS.
{ followSymbolicLinks: false }
)
const key = `${config.baseCacheKey}-${cacheConfig.name}-${hash}`
console.log(`Attempting to save ${paths} cache to ${key}`)
await cache.saveCache(paths, key)
Expand Down