mirror of
https://code.forgejo.org/actions/checkout.git
synced 2026-06-18 02:46:26 +00:00
Merge fbeb4a8af3 into df4cb1c069
This commit is contained in:
commit
cc1fbca669
3 changed files with 111 additions and 6 deletions
|
|
@ -366,9 +366,18 @@ class GitAuthHelper {
|
|||
true // globalConfig?
|
||||
)
|
||||
} else {
|
||||
// Host git directory
|
||||
let gitDir = path.join(this.git.getWorkingDirectory(), '.git')
|
||||
gitDir = gitDir.replace(/\\/g, '/') // Use forward slashes, even on Windows
|
||||
// Host git directory - resolve symlinks so includeIf gitdir matching works
|
||||
// on self-hosted runners where _work is a symlink to an external volume.
|
||||
let gitDir: string
|
||||
try {
|
||||
const constructed = path.join(this.git.getWorkingDirectory(), '.git')
|
||||
const resolved = await fs.promises.realpath(constructed)
|
||||
gitDir = resolved.replace(/\\/g, '/')
|
||||
} catch {
|
||||
// Fall back to constructed path if realpath fails
|
||||
gitDir = path.join(this.git.getWorkingDirectory(), '.git')
|
||||
gitDir = gitDir.replace(/\\/g, '/')
|
||||
}
|
||||
|
||||
// Configure host includeIf
|
||||
const hostIncludeKey = `includeIf.gitdir:${gitDir}.path`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue