Repository navigation
fix(scripts): support Windows paths and CRLF in protection and boundary scripts - #671
Open
Mohit-Gaur75 wants to merge 1 commit into
Open
Mohit-Gaur75 wants to merge 1 commit into
Mohit-Gaur75 wants to merge 1 commit into
Conversation
Mohit-Gaur75
requested review from
AsperforMias,
KurosawaGeeker and
hikariming
as code owners
November 24, 2026 05:16
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes cross-platform execution issues on Windows for repository gating scripts:
scripts/check-scoring-boundary.mjs:new URL("..", import.meta.url).pathnameproduced a path with a leading slash before the drive letter (e.g./C:/...) and percent-encoded spaces (%20). When passed topath.join, this causedENOENT: no such file or directory, scandir 'C:\C:\...'.scripts/feed-github-protection.mjs:validatePRChecksrelied on LF (\n) for regex boundary assertions (such asindexOf('\njobs:\n')returning-1and^ name: ${literal}$with$in multiline mode failing when lines end in\r\n). When checked out on Windows with default CRLF line endings, all 19 test cases infeed-github-protection.test.mjsfailed withRequired PR job scoring/Scoring parity (TS / Go / Python) and boundary absent.Changes
scripts/check-scoring-boundary.mjs:fileURLToPath(new URL("..", import.meta.url))fromnode:urlto properly resolve the workspace root across platforms.scripts/feed-github-protection.mjs:workflow.replace(/\r\n/g, '\n')) at the start ofvalidatePRChecks.scripts/feed-github-protection.test.mjs:.github/workflows/scoring.ymlso that string replacement assertions in tests match reliably across OS line ending conventions.Verification
node --test scripts/feed-github-protection.test.mjs: 19 passed, 0 failed.pnpm --filter @ghfind/scoring typecheck && pnpm --filter @ghfind/scoring test: 379 passed.python3 -m pytest -qinpackages/ghfind-py: 296 passed.