From 42b3ff04b29b03013d538e74611bec7bce5db98a Mon Sep 17 00:00:00 2001 From: Aiqiao Yan Date: Thu, 10 Dec 2020 10:59:04 -0500 Subject: [PATCH] Fix windows cache path --- packages/cache/RELEASES.md | 3 +++ packages/cache/package-lock.json | 4 +++- packages/cache/package.json | 2 +- packages/cache/src/internal/cacheUtils.ts | 4 +++- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/cache/RELEASES.md b/packages/cache/RELEASES.md index 97825762..5b94146a 100644 --- a/packages/cache/RELEASES.md +++ b/packages/cache/RELEASES.md @@ -30,3 +30,6 @@ ### 1.0.4 - Use @actions/core v1.2.6 - Fixes uploadChunk to throw an error if any unsuccessful response code is received + +### 1.0.5 +- Fix to ensure Windows cache paths get resolved correctly \ No newline at end of file diff --git a/packages/cache/package-lock.json b/packages/cache/package-lock.json index b928bcd4..b9d44210 100644 --- a/packages/cache/package-lock.json +++ b/packages/cache/package-lock.json @@ -1,6 +1,6 @@ { "name": "@actions/cache", - "version": "1.0.4", + "version": "1.0.5", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -28,6 +28,8 @@ }, "@actions/http-client": { "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.9.tgz", + "integrity": "sha512-0O4SsJ7q+MK0ycvXPl2e6bMXV7dxAXOGjrXS1eTF9s2S401Tp6c/P3c3Joz04QefC1J6Gt942Wl2jbm3f4mLcg==", "requires": { "tunnel": "0.0.6" }, diff --git a/packages/cache/package.json b/packages/cache/package.json index 6848c230..05635e8f 100644 --- a/packages/cache/package.json +++ b/packages/cache/package.json @@ -1,6 +1,6 @@ { "name": "@actions/cache", - "version": "1.0.4", + "version": "1.0.5", "preview": true, "description": "Actions cache lib", "keywords": [ diff --git a/packages/cache/src/internal/cacheUtils.ts b/packages/cache/src/internal/cacheUtils.ts index bdcef88d..36044d48 100644 --- a/packages/cache/src/internal/cacheUtils.ts +++ b/packages/cache/src/internal/cacheUtils.ts @@ -47,7 +47,9 @@ export async function resolvePaths(patterns: string[]): Promise { }) for await (const file of globber.globGenerator()) { - const relativeFile = path.relative(workspace, file) + const relativeFile = path + .relative(workspace, file) + .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}`)