mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2026-03-31 22:53:41 +08:00
Fix empty cache save on using or github.workspace(#833 in actions/cache) as path
This commit is contained in:
7
packages/cache/src/internal/cacheUtils.ts
vendored
7
packages/cache/src/internal/cacheUtils.ts
vendored
@@ -52,7 +52,12 @@ export async function resolvePaths(patterns: string[]): Promise<string[]> {
|
||||
.replace(new RegExp(`\\${path.sep}`, 'g'), '/')
|
||||
core.debug(`Matched: ${relativeFile}`)
|
||||
// Paths are made relative so the tar entries are all relative to the root of the workspace.
|
||||
paths.push(`${relativeFile}`)
|
||||
if (relativeFile === "") {
|
||||
// path.relative returns empty string if workspace and file are equal
|
||||
paths.push(".")
|
||||
} else {
|
||||
paths.push(`${relativeFile}`)
|
||||
}
|
||||
}
|
||||
|
||||
return paths
|
||||
|
||||
Reference in New Issue
Block a user