diff --git a/src/Cache.ts b/src/Cache.ts index 9f9e5658..f0a0794b 100644 --- a/src/Cache.ts +++ b/src/Cache.ts @@ -39,20 +39,10 @@ export class Cache { return null; } - public async putFileInCache( - url: string, - currentPath: string, - fileName: string, - overwrite?: boolean, - ): Promise { + public async putFileInCache(url: string, currentPath: string, fileName: string): Promise { const cachePath = this.getCachePath(url, fileName); d(`Moving ${currentPath} to ${cachePath}`); - if (await fs.pathExists(cachePath)) { - d('* Replacing existing file'); - await fs.remove(cachePath); - } - - await fs.move(currentPath, cachePath, { overwrite }); + await fs.move(currentPath, cachePath, { overwrite: true }); return cachePath; } diff --git a/src/index.ts b/src/index.ts index 8a7b7479..99cfef92 100644 --- a/src/index.ts +++ b/src/index.ts @@ -180,12 +180,7 @@ export async function downloadArtifact( await validateArtifact(details, tempDownloadPath, downloadArtifact); - return await cache.putFileInCache( - url, - tempDownloadPath, - fileName, - details.artifactName.startsWith('SHASUMS256'), // overwrite the SHASUMS in the cache - ); + return await cache.putFileInCache(url, tempDownloadPath, fileName); }); }