Fix glob pattern matching on Windows by converting paths to forward slashes

Co-authored-by: salmanmkc <32169182+salmanmkc@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-12-10 23:31:29 +00:00
parent 92cb8ef23c
commit 0483fce47e
20 changed files with 13 additions and 93544 deletions
+1
View File
@@ -5,3 +5,4 @@ packages/*/__tests__/_temp/
.DS_Store
*.xar
packages/*/audit.json
.nx/
-1180
View File
File diff suppressed because it is too large Load Diff
-1
View File
@@ -1 +0,0 @@
12463729879319616318
-21435
View File
File diff suppressed because it is too large Load Diff
-22019
View File
File diff suppressed because it is too large Load Diff
-42
View File
@@ -1,42 +0,0 @@
> @actions/tool-cache@2.0.2 tsc
> tsc
src/manifest.ts(1,25): error TS2307: Cannot find module 'semver' or its corresponding type declarations.
src/manifest.ts(2,21): error TS2307: Cannot find module '@actions/core' or its corresponding type declarations.
src/manifest.ts(7,21): error TS2307: Cannot find module 'os' or its corresponding type declarations.
src/manifest.ts(8,21): error TS2307: Cannot find module 'child_process' or its corresponding type declarations.
src/manifest.ts(9,21): error TS2307: Cannot find module 'fs' or its corresponding type declarations.
src/manifest.ts(89,29): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
src/manifest.ts(133,25): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
src/retry-helper.ts(1,23): error TS2307: Cannot find module '@actions/core' or its corresponding type declarations.
src/tool-cache.ts(1,23): error TS2307: Cannot find module '@actions/core' or its corresponding type declarations.
src/tool-cache.ts(2,21): error TS2307: Cannot find module '@actions/io' or its corresponding type declarations.
src/tool-cache.ts(3,25): error TS2307: Cannot find module 'crypto' or its corresponding type declarations.
src/tool-cache.ts(4,21): error TS2307: Cannot find module 'fs' or its corresponding type declarations.
src/tool-cache.ts(6,21): error TS2307: Cannot find module 'os' or its corresponding type declarations.
src/tool-cache.ts(7,23): error TS2307: Cannot find module 'path' or its corresponding type declarations.
src/tool-cache.ts(8,24): error TS2307: Cannot find module '@actions/http-client' or its corresponding type declarations.
src/tool-cache.ts(9,25): error TS2307: Cannot find module 'semver' or its corresponding type declarations.
src/tool-cache.ts(10,25): error TS2307: Cannot find module 'stream' or its corresponding type declarations.
src/tool-cache.ts(11,23): error TS2307: Cannot find module 'util' or its corresponding type declarations.
src/tool-cache.ts(12,18): error TS2307: Cannot find module 'assert' or its corresponding type declarations.
src/tool-cache.ts(13,35): error TS2307: Cannot find module 'http' or its corresponding type declarations.
src/tool-cache.ts(14,20): error TS2307: Cannot find module '@actions/exec/lib/exec' or its corresponding type declarations.
src/tool-cache.ts(15,27): error TS2307: Cannot find module '@actions/exec/lib/interfaces' or its corresponding type declarations.
src/tool-cache.ts(25,20): error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
src/tool-cache.ts(26,16): error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
src/tool-cache.ts(164,23): error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
src/tool-cache.ts(165,3): error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
src/tool-cache.ts(181,7): error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
src/tool-cache.ts(185,13): error TS2304: Cannot find name '__dirname'.
src/tool-cache.ts(208,7): error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
src/tool-cache.ts(242,22): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
src/tool-cache.ts(243,22): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
src/tool-cache.ts(257,32): error TS2339: Property 'includes' does not exist on type 'string | string[]'.
Property 'includes' does not exist on type 'string[]'.
src/tool-cache.ts(657,3): error TS2322: Type 'string | undefined' is not assignable to type 'string'.
Type 'undefined' is not assignable to type 'string'.
src/tool-cache.ts(747,26): error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
src/tool-cache.ts(756,25): error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
src/tool-cache.ts(766,18): error TS2304: Cannot find name 'global'.
-36
View File
@@ -1,36 +0,0 @@
> @actions/github@6.0.1 tsc
> tsc
src/context.ts(3,40): error TS2307: Cannot find module 'fs' or its corresponding type declarations.
src/context.ts(4,19): error TS2307: Cannot find module 'os' or its corresponding type declarations.
src/context.ts(31,9): error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
src/context.ts(32,22): error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
src/context.ts(34,24): error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
src/context.ts(37,22): error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
src/context.ts(38,9): error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
src/context.ts(41,22): error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
src/context.ts(42,16): error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
src/context.ts(43,16): error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
src/context.ts(44,21): error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
src/context.ts(45,19): error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
src/context.ts(46,18): error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
src/context.ts(47,16): error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
src/context.ts(48,32): error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
src/context.ts(49,31): error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
src/context.ts(50,27): error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
src/context.ts(51,19): error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
src/context.ts(52,22): error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
src/context.ts(54,7): error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
src/context.ts(67,9): error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
src/context.ts(68,29): error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
src/github.ts(5,45): error TS2307: Cannot find module '@octokit/core/dist-types/types' or its corresponding type declarations.
src/internal/utils.ts(1,23): error TS2307: Cannot find module 'http' or its corresponding type declarations.
src/internal/utils.ts(2,29): error TS2307: Cannot find module '@actions/http-client' or its corresponding type declarations.
src/internal/utils.ts(3,30): error TS2307: Cannot find module '@octokit/core/dist-types/types' or its corresponding type declarations.
src/internal/utils.ts(4,33): error TS2307: Cannot find module 'undici' or its corresponding type declarations.
src/internal/utils.ts(43,10): error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
src/utils.ts(5,23): error TS2307: Cannot find module '@octokit/core' or its corresponding type declarations.
src/utils.ts(6,30): error TS2307: Cannot find module '@octokit/core/dist-types/types' or its corresponding type declarations.
src/utils.ts(7,35): error TS2307: Cannot find module '@octokit/plugin-rest-endpoint-methods' or its corresponding type declarations.
src/utils.ts(8,28): error TS2307: Cannot find module '@octokit/plugin-paginate-rest' or its corresponding type declarations.
File diff suppressed because it is too large Load Diff
@@ -1 +0,0 @@
7754673536164768964
-1
View File
@@ -1 +0,0 @@
7754673536164768964
Binary file not shown.
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+12 -1
View File
@@ -156,6 +156,12 @@ export class Pattern {
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
if (IS_WINDOWS) {
itemPath = itemPath.replace(/\\/g, '/')
}
// Match
if (this.minimatch.match(itemPath)) {
return this.trailingSeparator ? MatchKind.Directory : MatchKind.All
@@ -176,8 +182,13 @@ export class Pattern {
return this.rootRegExp.test(itemPath)
}
// Convert to forward slashes on Windows to match the pattern format used by minimatch
if (IS_WINDOWS) {
itemPath = itemPath.replace(/\\/g, '/')
}
return this.minimatch.matchOne(
itemPath.split(IS_WINDOWS ? /\\+/ : /\/+/),
itemPath.split(/\/+/),
this.minimatch.set[0],
true
)