Skip to content

Commit

Permalink
Fix windows cache path
Browse files Browse the repository at this point in the history
  • Loading branch information
aiqiaoy committed Dec 10, 2020
1 parent 8d11ee5 commit 42b3ff0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions packages/cache/RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 3 additions & 1 deletion packages/cache/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/cache/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@actions/cache",
"version": "1.0.4",
"version": "1.0.5",
"preview": true,
"description": "Actions cache lib",
"keywords": [
Expand Down
4 changes: 3 additions & 1 deletion packages/cache/src/internal/cacheUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ export async function resolvePaths(patterns: string[]): Promise<string[]> {
})

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}`)
Expand Down

0 comments on commit 42b3ff0

Please sign in to comment.