Fix includeIf case sensitivity on Windows self-hosted runners#2425
Open
salmanmkc wants to merge 1 commit into
Open
Fix includeIf case sensitivity on Windows self-hosted runners#2425salmanmkc wants to merge 1 commit into
salmanmkc wants to merge 1 commit into
Conversation
9979a83 to
c0c6be9
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a Windows-only regression where includeIf.gitdir: path matching is case-sensitive, causing credential include rules to fail when GITHUB_WORKSPACE casing differs from the on-disk path casing. It does so by using Git’s case-insensitive gitdir/i: condition on Windows while keeping existing behavior on other platforms.
Changes:
- Introduces a platform-dependent
INCLUDE_IF_GITDIRprefix (includeIf.gitdir/i:on Windows,includeIf.gitdir:elsewhere). - Updates all
includeIfkey construction sites to use the new prefix. - Updates the cleanup key-regex to remove both
gitdir:andgitdir/i:includeIf entries.
Show a summary per file
| File | Description |
|---|---|
| src/git-auth-helper.ts | Adds a Windows-specific includeIf.gitdir/i: prefix and broadens cleanup matching to handle both variants. |
| dist/index.js | Regenerates the bundled output to reflect the TypeScript source changes. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/2 changed files
- Comments generated: 1
Comment on lines
15
to
+20
| const IS_WINDOWS = process.platform === 'win32' | ||
| // Use case-insensitive gitdir matching on Windows to handle path casing mismatches | ||
| // between the runner's GITHUB_WORKSPACE and the actual filesystem casing. | ||
| // See: https://github.com/actions/checkout/issues/2345 | ||
| const INCLUDE_IF_GITDIR = IS_WINDOWS | ||
| ? 'includeIf.gitdir/i:' |
c0c6be9 to
6e134d0
Compare
Switch to includeIf.gitdir/i: on Windows so path matching is case-insensitive, matching the filesystem behavior. This fixes auth failures on self-hosted Windows runners where the workspace folder casing doesn't match between the runner config and disk. Also update the cleanup regex to handle both gitdir: and gitdir/i: variants. Fixes #2345
6e134d0 to
be385d8
Compare
ericsciple
approved these changes
May 6, 2026
ericsciple
approved these changes
May 6, 2026
This was referenced May 28, 2026
trek-e
added a commit
to open-gsd/gsd-core
that referenced
this pull request
May 28, 2026
…PT_ACTIONS_TO_NODE24 (node20 EOL) (#446) Problem: Node 20 deprecation warnings fired on every CI run. Despite FORCE_JAVASCRIPT_ACTIONS_TO_NODE24=true in test.yml (added in PR #350), the warning is not silenced — the env var only changes which warning fires (both paths call context.Warning()). The only silent path is for the action itself to declare `using: node24`. Ref: https://github.com/actions/runner/blob/main/src/Runner.Common/Util/NodeUtil.cs Ref: https://github.com/actions/runner/blob/main/src/Runner.Worker/JobExtension.cs Three locations used @v4 actions (node20 runtime): 1. test.yml — Windows lanes (test + test-full jobs) pinned to actions/checkout@11bd719 (v4.2.2). Original pin rationale (PR #162 / issue #161): v6 uses includeIf.gitdir: for auth injection, which is unreliable on Windows git 2.54. v5 never used includeIf, so it is safe for Windows. Upstream confirmation: actions/checkout#2425 v5 action.yml declares `using: node24`: https://raw.githubusercontent.com/actions/checkout/v5/action.yml 2. changeset-required.yml — floating actions/checkout@v4 + actions/setup-node@v4 3. docs-required.yml — same floating @v4 pattern Changes: - test.yml: both Windows checkout steps v4.2.2 → v5.0.1 (SHA 11bd71901bbe5b1630ceea73d27597364c9af683 → 93cb6efe18208431cddfb8368fd83d5badbf9bfd) - test.yml: update comment on Windows checkout to reflect v5 rationale - test.yml: no FORCE_JAVASCRIPT_ACTIONS_TO_NODE24 was present on origin/next (already absent; the env block was on the main-branch version only) - changeset-required.yml: actions/checkout@v4 → @93cb6efe18208431cddfb8368fd83d5badbf9bfd (v5.0.1) - changeset-required.yml: actions/setup-node@v4 → @a0853c24544627f65ddf259abe73b1d18a591444 (v5.0.0) - docs-required.yml: same as changeset-required.yml SHAs resolved from upstream tags: - checkout v5.0.1: gh api repos/actions/checkout/git/ref/tags/v5.0.1 → 93cb6efe18208431cddfb8368fd83d5badbf9bfd - setup-node v5.0.0: gh api repos/actions/setup-node/git/ref/tags/v5.0.0 → a0853c24544627f65ddf259abe73b1d18a591444 Closes #445 Co-authored-by: CI Rebase Check <ci@gsd-redux>
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.
On Windows,
includeIf.gitdir:does case-sensitive path matching even though the filesystem is case-insensitive. When a self-hosted Windows runner has a pre-existing workspace folder with different casing than what the runner config specifies (e.g.D:\Workspaceson disk vsD:\workspacesin config), theincludeIfcondition never matches and git auth silently fails.This was introduced in v6 with the move to credential isolation via
includeIf(#2286). v5 did not useincludeIfso it was never an issue. GitHub-hosted runners are not affected since they use a lowercase workspace folder.Git already has a case-insensitive variant:
gitdir/i:(available since 2.13.0, well before our minimum of 2.18). This PR switches togitdir/i:on Windows while keepinggitdir:on Linux/macOS where case sensitivity is expected.Also updates the cleanup regex to handle both variants so credential removal still works.
Fixes #2345