Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1cd929181f | ||
|
|
f4d818c7a2 | ||
|
|
9de8f6f5c3 | ||
|
|
a60e6db920 | ||
|
|
c050f7bc2e | ||
|
|
0483fce47e | ||
|
|
92cb8ef23c | ||
|
|
5d702dc7bd |
@@ -5,3 +5,4 @@ packages/*/__tests__/_temp/
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
*.xar
|
*.xar
|
||||||
packages/*/audit.json
|
packages/*/audit.json
|
||||||
|
.nx/
|
||||||
|
|||||||
Vendored
+7
-9
@@ -8,19 +8,17 @@ Note that GitHub will remove any cache entries that have not been accessed in ov
|
|||||||
|
|
||||||
## ⚠️ Important changes
|
## ⚠️ Important changes
|
||||||
|
|
||||||
### Node.js 24 Support
|
|
||||||
|
|
||||||
Version `5.0.0` adds support for Node.js 24 and updates all `@actions/*` dependencies to their latest major versions.
|
|
||||||
|
|
||||||
### Cache Service v2
|
|
||||||
|
|
||||||
The cache backend service has been rewritten from the ground up for improved performance and reliability. The [@actions/cache](https://github.com/actions/toolkit/tree/main/packages/cache) package now integrates with the new cache service (v2) APIs.
|
The cache backend service has been rewritten from the ground up for improved performance and reliability. The [@actions/cache](https://github.com/actions/toolkit/tree/main/packages/cache) package now integrates with the new cache service (v2) APIs.
|
||||||
|
|
||||||
The new service rolled out as of **February 1st, 2025**. The legacy service was also sunset on the same date. Changes in version `4.0.0` are **fully backward compatible**.
|
The new service will gradually roll out as of **February 1st, 2025**. The legacy service will also be sunset on the same date. Changes in this release are **fully backward compatible**.
|
||||||
|
|
||||||
**All versions prior to 4.0.0 are deprecated**. We recommend upgrading to version `5.0.0` for the latest features and Node.js 24 support.
|
**All previous versions of this package will be deprecated**. We recommend upgrading to version `4.0.0` as soon as possible before **February 1st, 2025.**
|
||||||
|
|
||||||
Read more about the cache service v2 change & access the migration guide: [reference to the announcement](https://github.com/actions/toolkit/discussions/1890).
|
If you do not upgrade, all workflow runs using any of the deprecated [@actions/cache](https://github.com/actions/toolkit/tree/main/packages/cache) packages will fail.
|
||||||
|
|
||||||
|
Upgrading to the recommended version should not break or require any changes to your workflows beyond updating your `package.json` to version `4.0.0`.
|
||||||
|
|
||||||
|
Read more about the change & access the migration guide: [reference to the announcement](https://github.com/actions/toolkit/discussions/1890).
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
|||||||
Vendored
-12
@@ -1,17 +1,5 @@
|
|||||||
# @actions/cache Releases
|
# @actions/cache Releases
|
||||||
|
|
||||||
### 5.0.0
|
|
||||||
|
|
||||||
- Remove `@azure/ms-rest-js` dependency [#2197](https://github.com/actions/toolkit/pull/2197)
|
|
||||||
- The `TransferProgressEvent` type is now imported from `@azure/core-rest-pipeline` instead of `@azure/ms-rest-js`
|
|
||||||
- Bump `@actions/core` from `^1.11.1` to `^2.0.0` [#2198](https://github.com/actions/toolkit/pull/2198)
|
|
||||||
- Bump `@actions/exec` from `^1.0.1` to `^2.0.0` [#2198](https://github.com/actions/toolkit/pull/2198)
|
|
||||||
- Bump `@actions/glob` from `^0.1.0` to `^0.5.0` [#2198](https://github.com/actions/toolkit/pull/2198)
|
|
||||||
- Bump `@actions/http-client` from `^2.1.1` to `^3.0.0` [#2198](https://github.com/actions/toolkit/pull/2198)
|
|
||||||
- Bump `@actions/io` from `^1.0.1` to `^2.0.0` [#2198](https://github.com/actions/toolkit/pull/2198)
|
|
||||||
- Add support for Node.js 24 [#2110](https://github.com/actions/toolkit/pull/2110)
|
|
||||||
- Add `node-fetch` override to resolve audit vulnerabilities [#2110](https://github.com/actions/toolkit/pull/2110)
|
|
||||||
|
|
||||||
### 4.1.0
|
### 4.1.0
|
||||||
|
|
||||||
- Remove client side 10GiB cache size limit check & update twirp client [#2118](https://github.com/actions/toolkit/pull/2118)
|
- Remove client side 10GiB cache size limit check & update twirp client [#2118](https://github.com/actions/toolkit/pull/2118)
|
||||||
|
|||||||
+19
-53
@@ -9,11 +9,11 @@
|
|||||||
"version": "5.0.0",
|
"version": "5.0.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^2.0.0",
|
"@actions/core": "^1.11.1",
|
||||||
"@actions/exec": "^2.0.0",
|
"@actions/exec": "^1.0.1",
|
||||||
"@actions/glob": "^0.5.0",
|
"@actions/glob": "^0.1.0",
|
||||||
"@actions/http-client": "^3.0.0",
|
"@actions/http-client": "^2.1.1",
|
||||||
"@actions/io": "^2.0.0",
|
"@actions/io": "^1.0.1",
|
||||||
"@azure/abort-controller": "^1.1.0",
|
"@azure/abort-controller": "^1.1.0",
|
||||||
"@azure/core-rest-pipeline": "^1.22.0",
|
"@azure/core-rest-pipeline": "^1.22.0",
|
||||||
"@azure/storage-blob": "^12.13.0",
|
"@azure/storage-blob": "^12.13.0",
|
||||||
@@ -28,35 +28,6 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@actions/core": {
|
"node_modules/@actions/core": {
|
||||||
"version": "2.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@actions/core/-/core-2.0.1.tgz",
|
|
||||||
"integrity": "sha512-oBfqT3GwkvLlo1fjvhQLQxuwZCGTarTE5OuZ2Wg10hvhBj7LRIlF611WT4aZS6fDhO5ZKlY7lCAZTlpmyaHaeg==",
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"@actions/exec": "^2.0.0",
|
|
||||||
"@actions/http-client": "^3.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@actions/exec": {
|
|
||||||
"version": "2.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@actions/exec/-/exec-2.0.0.tgz",
|
|
||||||
"integrity": "sha512-k8ngrX2voJ/RIN6r9xB82NVqKpnMRtxDoiO+g3olkIUpQNqjArXrCQceduQZCQj3P3xm32pChRLqRrtXTlqhIw==",
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"@actions/io": "^2.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@actions/glob": {
|
|
||||||
"version": "0.5.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.5.0.tgz",
|
|
||||||
"integrity": "sha512-tST2rjPvJLRZLuT9NMUtyBjvj9Yo0MiJS3ow004slMvm8GFM+Zv9HvMJ7HWzfUyJnGrJvDsYkWBaaG3YKXRtCw==",
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"@actions/core": "^1.9.1",
|
|
||||||
"minimatch": "^3.0.4"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@actions/glob/node_modules/@actions/core": {
|
|
||||||
"version": "1.11.1",
|
"version": "1.11.1",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.11.1.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.11.1.tgz",
|
||||||
"integrity": "sha512-hXJCSrkwfA46Vd9Z3q4cpEpHB1rL5NG04+/rbqW9d3+CSvtB1tYe8UTpAlixa1vj0m/ULglfEK2UKxMGxCxv5A==",
|
"integrity": "sha512-hXJCSrkwfA46Vd9Z3q4cpEpHB1rL5NG04+/rbqW9d3+CSvtB1tYe8UTpAlixa1vj0m/ULglfEK2UKxMGxCxv5A==",
|
||||||
@@ -66,7 +37,7 @@
|
|||||||
"@actions/http-client": "^2.0.1"
|
"@actions/http-client": "^2.0.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@actions/glob/node_modules/@actions/exec": {
|
"node_modules/@actions/exec": {
|
||||||
"version": "1.1.1",
|
"version": "1.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.1.1.tgz",
|
||||||
"integrity": "sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w==",
|
"integrity": "sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w==",
|
||||||
@@ -75,7 +46,17 @@
|
|||||||
"@actions/io": "^1.0.1"
|
"@actions/io": "^1.0.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@actions/glob/node_modules/@actions/http-client": {
|
"node_modules/@actions/glob": {
|
||||||
|
"version": "0.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.1.2.tgz",
|
||||||
|
"integrity": "sha512-SclLR7Ia5sEqjkJTPs7Sd86maMDw43p769YxBOxvPvEWuPEhpAnBsQfENOpXjFYMmhCqd127bmf+YdvJqVqR4A==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@actions/core": "^1.2.6",
|
||||||
|
"minimatch": "^3.0.4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@actions/http-client": {
|
||||||
"version": "2.2.3",
|
"version": "2.2.3",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.2.3.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.2.3.tgz",
|
||||||
"integrity": "sha512-mx8hyJi/hjFvbPokCg4uRd4ZX78t+YyRPtnKWwIl+RzNaVuFpQHfmlGVfsKEJN8LwTCvL+DfVgAM04XaHkm6bA==",
|
"integrity": "sha512-mx8hyJi/hjFvbPokCg4uRd4ZX78t+YyRPtnKWwIl+RzNaVuFpQHfmlGVfsKEJN8LwTCvL+DfVgAM04XaHkm6bA==",
|
||||||
@@ -85,28 +66,12 @@
|
|||||||
"undici": "^5.25.4"
|
"undici": "^5.25.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@actions/glob/node_modules/@actions/io": {
|
"node_modules/@actions/io": {
|
||||||
"version": "1.1.3",
|
"version": "1.1.3",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.3.tgz",
|
||||||
"integrity": "sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q==",
|
"integrity": "sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q==",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/@actions/http-client": {
|
|
||||||
"version": "3.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-3.0.0.tgz",
|
|
||||||
"integrity": "sha512-1s3tXAfVMSz9a4ZEBkXXRQD4QhY3+GAsWSbaYpeknPOKEeyRiU3lH+bHiLMZdo2x/fIeQ/hscL1wCkDLVM2DZQ==",
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"tunnel": "^0.0.6",
|
|
||||||
"undici": "^5.28.5"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@actions/io": {
|
|
||||||
"version": "2.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@actions/io/-/io-2.0.0.tgz",
|
|
||||||
"integrity": "sha512-Jv33IN09XLO+0HS79aaODsvIRyduiF7NY/F6LYeK5oeUmrsz7aFdRphQjFoESF4jS7lMauDOttKALcpapVDIAg==",
|
|
||||||
"license": "MIT"
|
|
||||||
},
|
|
||||||
"node_modules/@azure/abort-controller": {
|
"node_modules/@azure/abort-controller": {
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-1.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-1.1.0.tgz",
|
||||||
@@ -708,6 +673,7 @@
|
|||||||
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
|
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
|
"peer": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"tsc": "bin/tsc",
|
"tsc": "bin/tsc",
|
||||||
"tsserver": "bin/tsserver"
|
"tsserver": "bin/tsserver"
|
||||||
|
|||||||
Vendored
+5
-5
@@ -37,12 +37,12 @@
|
|||||||
"url": "https://github.com/actions/toolkit/issues"
|
"url": "https://github.com/actions/toolkit/issues"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^2.0.0",
|
"@actions/core": "^1.11.1",
|
||||||
"@actions/exec": "^2.0.0",
|
"@actions/exec": "^1.0.1",
|
||||||
"@actions/glob": "^0.5.0",
|
"@actions/glob": "^0.1.0",
|
||||||
"@protobuf-ts/runtime-rpc": "^2.11.1",
|
"@protobuf-ts/runtime-rpc": "^2.11.1",
|
||||||
"@actions/http-client": "^3.0.0",
|
"@actions/http-client": "^2.1.1",
|
||||||
"@actions/io": "^2.0.0",
|
"@actions/io": "^1.0.1",
|
||||||
"@azure/abort-controller": "^1.1.0",
|
"@azure/abort-controller": "^1.1.0",
|
||||||
"@azure/core-rest-pipeline": "^1.22.0",
|
"@azure/core-rest-pipeline": "^1.22.0",
|
||||||
"@azure/storage-blob": "^12.13.0",
|
"@azure/storage-blob": "^12.13.0",
|
||||||
|
|||||||
@@ -0,0 +1,83 @@
|
|||||||
|
/**
|
||||||
|
* Test to validate that glob works correctly on Windows with backslash paths
|
||||||
|
* This test validates the fix for glob not working on GitHub's Windows runners
|
||||||
|
*/
|
||||||
|
|
||||||
|
import {MatchKind} from '../src/internal-match-kind'
|
||||||
|
import {Pattern} from '../src/internal-pattern'
|
||||||
|
|
||||||
|
const IS_WINDOWS = process.platform === 'win32'
|
||||||
|
|
||||||
|
describe('Windows path matching', () => {
|
||||||
|
it('matches paths with backslashes on Windows', () => {
|
||||||
|
if (!IS_WINDOWS) {
|
||||||
|
// This test is only relevant on Windows
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Test basic pattern matching with Windows paths
|
||||||
|
const pattern = new Pattern('C:\\Users\\test\\*')
|
||||||
|
|
||||||
|
// The itemPath would come from fs.readdir with backslashes on Windows
|
||||||
|
const itemPath = 'C:\\Users\\test\\file.txt'
|
||||||
|
|
||||||
|
// This should match because the pattern and path both refer to the same file
|
||||||
|
expect(pattern.match(itemPath)).toBe(MatchKind.All)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('partial matches work with backslashes on Windows', () => {
|
||||||
|
if (!IS_WINDOWS) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Test partial matching with Windows paths
|
||||||
|
const pattern = new Pattern('C:\\Users\\test\\**')
|
||||||
|
|
||||||
|
// Should partially match parent directory
|
||||||
|
expect(pattern.partialMatch('C:\\Users')).toBe(true)
|
||||||
|
expect(pattern.partialMatch('C:\\Users\\test')).toBe(true)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('matches globstar patterns with backslashes on Windows', () => {
|
||||||
|
if (!IS_WINDOWS) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const pattern = new Pattern('C:\\foo\\**')
|
||||||
|
|
||||||
|
// Should match the directory itself and descendants
|
||||||
|
expect(pattern.match('C:\\foo')).toBe(MatchKind.All)
|
||||||
|
expect(pattern.match('C:\\foo\\bar')).toBe(MatchKind.All)
|
||||||
|
expect(pattern.match('C:\\foo\\bar\\baz.txt')).toBe(MatchKind.All)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('matches wildcard patterns with mixed separators on Windows', () => {
|
||||||
|
if (!IS_WINDOWS) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Pattern might be specified with forward slashes by user
|
||||||
|
const pattern = new Pattern('C:/Users/*/file.txt')
|
||||||
|
|
||||||
|
// But the actual path from filesystem will have backslashes
|
||||||
|
expect(pattern.match('C:\\Users\\test\\file.txt')).toBe(MatchKind.All)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('handles complex patterns with backslashes on Windows', () => {
|
||||||
|
if (!IS_WINDOWS) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const currentDrive = process.cwd().substring(0, 2)
|
||||||
|
const pattern = new Pattern(`${currentDrive}\\**\\*.txt`)
|
||||||
|
|
||||||
|
// Should match .txt files at any depth
|
||||||
|
expect(pattern.match(`${currentDrive}\\file.txt`)).toBe(MatchKind.All)
|
||||||
|
expect(pattern.match(`${currentDrive}\\foo\\bar\\test.txt`)).toBe(
|
||||||
|
MatchKind.All
|
||||||
|
)
|
||||||
|
expect(pattern.match(`${currentDrive}\\foo\\bar\\test.js`)).toBe(
|
||||||
|
MatchKind.None
|
||||||
|
)
|
||||||
|
})
|
||||||
|
})
|
||||||
@@ -156,6 +156,10 @@ export class Pattern {
|
|||||||
itemPath = pathHelper.safeTrimTrailingSeparator(itemPath)
|
itemPath = pathHelper.safeTrimTrailingSeparator(itemPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Convert to forward slashes on Windows before matching with minimatch
|
||||||
|
// since the pattern was converted to forward slashes in the constructor
|
||||||
|
itemPath = Pattern.convertToMinimatchPath(itemPath)
|
||||||
|
|
||||||
// Match
|
// Match
|
||||||
if (this.minimatch.match(itemPath)) {
|
if (this.minimatch.match(itemPath)) {
|
||||||
return this.trailingSeparator ? MatchKind.Directory : MatchKind.All
|
return this.trailingSeparator ? MatchKind.Directory : MatchKind.All
|
||||||
@@ -176,8 +180,11 @@ export class Pattern {
|
|||||||
return this.rootRegExp.test(itemPath)
|
return this.rootRegExp.test(itemPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Convert to forward slashes on Windows to match the pattern format used by minimatch
|
||||||
|
itemPath = Pattern.convertToMinimatchPath(itemPath)
|
||||||
|
|
||||||
return this.minimatch.matchOne(
|
return this.minimatch.matchOne(
|
||||||
itemPath.split(IS_WINDOWS ? /\\+/ : /\/+/),
|
itemPath.split(/\/+/),
|
||||||
this.minimatch.set[0],
|
this.minimatch.set[0],
|
||||||
true
|
true
|
||||||
)
|
)
|
||||||
@@ -193,6 +200,18 @@ export class Pattern {
|
|||||||
.replace(/\*/g, '[*]') // escape '*'
|
.replace(/\*/g, '[*]') // escape '*'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converts path to forward slashes on Windows for compatibility with minimatch.
|
||||||
|
* On Windows, minimatch patterns use forward slashes, so paths must be converted
|
||||||
|
* to match the same format.
|
||||||
|
*/
|
||||||
|
private static convertToMinimatchPath(itemPath: string): string {
|
||||||
|
if (IS_WINDOWS) {
|
||||||
|
return itemPath.replace(/\\/g, '/')
|
||||||
|
}
|
||||||
|
return itemPath
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Normalizes slashes and ensures absolute root
|
* Normalizes slashes and ensures absolute root
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user