Description
actions/checkout@v6 fails to authenticate during the fetch step on self-hosted
runners where the _work directory is a symlink to a different path (e.g. an
external volume).
v6 writes includeIf "gitdir:..." directives using the symlink path, but git
resolves symlinks when evaluating gitdir: conditions. This means the condition
never matches, the credentials file is never loaded, and the fetch fails with:
fatal: could not read Username for 'https://github.com': terminal prompts disabled
actions/checkout@v5 is unaffected because it writes credentials directly into
.git/config as http.https://github.com/.extraheader rather than using includeIf.
Environment
actions/checkout: v6.0.2 (de0fac2e4500dabe0009e67214ff5f5447ce83dd)
- Runner version: 2.333.0
- OS: macOS (Apple Silicon, self-hosted)
- Git version: 2.53.0 (Homebrew,
/opt/homebrew/bin/git)
- Runner
_work directory: symlink → external volume
- Symlink path:
/Users/<runner-user>/actions-runner-N/_work
- Resolved path:
/Volumes/External/actions-runner-N-work
What v6 writes into .git/config
[includeIf "gitdir:/Users/<runner-user>/actions-runner-N/_work/repo/repo/.git"]
path = /Users/<runner-user>/actions-runner-N/_work/_temp/git-credentials-<uuid>.config
[includeIf "gitdir:/Users/<runner-user>/actions-runner-N/_work/repo/repo/.git/worktrees/*"]
path = /Users/<runner-user>/actions-runner-N/_work/_temp/git-credentials-<uuid>.config
What git resolves the gitdir to
$ git -C /Users/<runner-user>/actions-runner-N/_work/repo/repo rev-parse --absolute-git-dir
/Volumes/External/actions-runner-N-work/repo/repo/.git
The includeIf condition uses the symlink path, but git evaluates it against
the resolved real path. They never match, so the credentials file is never
included and the fetch fails.
Steps to reproduce
- Set up a self-hosted macOS runner where
_work is a symlink to a different
path (e.g. an external drive)
- Use
actions/checkout@v6 in a workflow
- Observe fetch failure with
terminal prompts disabled
Expected behavior
v6 should either:
- Resolve symlinks when writing the
gitdir: path in includeIf directives
(use git rev-parse --absolute-git-dir to get the real path), or
- Fall back to writing credentials directly into
.git/config as v5 did when
symlink resolution would cause a mismatch
Workaround
Pin to actions/checkout@v5 which uses http.extraheader directly in
.git/config and is unaffected by symlink resolution.
Related issues
Description
actions/checkout@v6fails to authenticate during the fetch step on self-hostedrunners where the
_workdirectory is a symlink to a different path (e.g. anexternal volume).
v6 writes
includeIf "gitdir:..."directives using the symlink path, but gitresolves symlinks when evaluating
gitdir:conditions. This means the conditionnever matches, the credentials file is never loaded, and the fetch fails with:
actions/checkout@v5is unaffected because it writes credentials directly into.git/configashttp.https://github.com/.extraheaderrather than usingincludeIf.Environment
actions/checkout: v6.0.2 (de0fac2e4500dabe0009e67214ff5f5447ce83dd)/opt/homebrew/bin/git)_workdirectory: symlink → external volume/Users/<runner-user>/actions-runner-N/_work/Volumes/External/actions-runner-N-workWhat v6 writes into
.git/configWhat git resolves the gitdir to
The
includeIfcondition uses the symlink path, but git evaluates it againstthe resolved real path. They never match, so the credentials file is never
included and the fetch fails.
Steps to reproduce
_workis a symlink to a differentpath (e.g. an external drive)
actions/checkout@v6in a workflowterminal prompts disabledExpected behavior
v6 should either:
gitdir:path inincludeIfdirectives(use
git rev-parse --absolute-git-dirto get the real path), or.git/configas v5 did whensymlink resolution would cause a mismatch
Workaround
Pin to
actions/checkout@v5which useshttp.extraheaderdirectly in.git/configand is unaffected by symlink resolution.Related issues
includeIfpersist-credentialsin separate file breaks GitHub authentication for Git worktrees #2318 —persist-credentialsin separate file breaks git worktrees