-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Description
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
_workdirectory: symlink → external volume- Symlink path:
/Users/<runner-user>/actions-runner-N/_work - Resolved path:
/Volumes/External/actions-runner-N-work
- Symlink path:
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>.configWhat 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/.gitThe 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
_workis a symlink to a different
path (e.g. an external drive) - Use
actions/checkout@v6in a workflow - Observe fetch failure with
terminal prompts disabled
Expected behavior
v6 should either:
- Resolve symlinks when writing the
gitdir:path inincludeIfdirectives
(usegit rev-parse --absolute-git-dirto get the real path), or - Fall back to writing credentials directly into
.git/configas 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
- actions/checkout@v6 broken on non-GitHub runners (Forgejo, Gitea, etc.) - hardcoded GitHub paths in includeIf directives break authentication #2321 — v6 broken on non-GitHub runners due to hardcoded paths in
includeIf persist-credentialsin separate file breaks GitHub authentication for Git worktrees #2318 —persist-credentialsin separate file breaks git worktrees- checkout@v6 credentials don't work with Docker container actions - no workaround available #2359 — v6 credentials don't work with Docker container actions