mirror of
https://github.com/actions/toolkit.git
synced 2026-08-16 00:00:21 +02:00
feat: optional path validation during cache restore
This commit is contained in:
+12
-3
@@ -210,7 +210,10 @@ test('restore with gzip compressed cache found', async () => {
|
||||
expect(logInfoMock).toHaveBeenCalledWith(`Cache Size: ~0 MB (142 B)`)
|
||||
|
||||
expect(extractTarMock).toHaveBeenCalledTimes(1)
|
||||
expect(extractTarMock).toHaveBeenCalledWith(archivePath, compressionMethod)
|
||||
expect(extractTarMock).toHaveBeenCalledWith(archivePath, compressionMethod, {
|
||||
declaredPaths: paths,
|
||||
pathValidation: undefined
|
||||
})
|
||||
|
||||
expect(unlinkFileMock).toHaveBeenCalledTimes(1)
|
||||
expect(unlinkFileMock).toHaveBeenCalledWith(archivePath)
|
||||
@@ -287,7 +290,10 @@ test('restore with zstd compressed cache found', async () => {
|
||||
expect(logInfoMock).toHaveBeenCalledWith(`Cache Size: ~60 MB (62915000 B)`)
|
||||
|
||||
expect(extractTarMock).toHaveBeenCalledTimes(1)
|
||||
expect(extractTarMock).toHaveBeenCalledWith(archivePath, compressionMethod)
|
||||
expect(extractTarMock).toHaveBeenCalledWith(archivePath, compressionMethod, {
|
||||
declaredPaths: paths,
|
||||
pathValidation: undefined
|
||||
})
|
||||
|
||||
expect(unlinkFileMock).toHaveBeenCalledTimes(1)
|
||||
expect(unlinkFileMock).toHaveBeenCalledWith(archivePath)
|
||||
@@ -367,7 +373,10 @@ test('restore with cache found for restore key', async () => {
|
||||
expect(logInfoMock).toHaveBeenCalledWith(`Cache Size: ~0 MB (142 B)`)
|
||||
|
||||
expect(extractTarMock).toHaveBeenCalledTimes(1)
|
||||
expect(extractTarMock).toHaveBeenCalledWith(archivePath, compressionMethod)
|
||||
expect(extractTarMock).toHaveBeenCalledWith(archivePath, compressionMethod, {
|
||||
declaredPaths: paths,
|
||||
pathValidation: undefined
|
||||
})
|
||||
|
||||
expect(unlinkFileMock).toHaveBeenCalledTimes(1)
|
||||
expect(unlinkFileMock).toHaveBeenCalledWith(archivePath)
|
||||
|
||||
Reference in New Issue
Block a user