-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Checkout breaks symlinked gitconfig on self-hosted runner #650
Comments
Note the line in question is here checkout/src/git-auth-helper.ts Line 108 in ec3a7ce
I am not familiar enough with github actions io to fix, but there needs to be some check if the file is a symlink and then copy the actual contents of the file rather than the symlink itself. |
Looking at the source for @actions/io, it seems like there needs to be some check like this: for lines here: checkout/src/git-auth-helper.ts Lines 106 to 111 in ec3a7ce
if (configExists) {
core.info(`Copying '${gitConfigPath}' to '${newGitConfigPath}'`)
if ((await ioUtil.lstat(gitConfigPath)).isSymbolicLink()) {
// get true link
const symlinkFull: string = await ioUtil.readlink(srcFile)
await io.cp(symlinkFull, newGitConfigPath)
} else {
await io.cp(gitConfigPath, newGitConfigPath)
}
} else {
await fs.promises.writeFile(newGitConfigPath, '')
} |
Thanks for pointing this out, I've been struggling for some time trying to understand why none of my repos were accessibe anymore: this was caused by the GitHub Actions runner modifying my symlinked |
I made a pr but they dont seem too interested |
This Issue is open since last 7 months and @msdrigg has already submitted PR for the same and awaiting for review and merge. |
Does v4 solve this? |
I am not self-hosting runners any more, but it doesn't look like it checkout/src/git-auth-helper.ts Line 113 in cd7d8d6
(Same line as above that uses |
I can confirm v4 doesnt solve the issue. |
This is still causing problems for me, too. |
What problem actually
…On Sat, Jan 25, 2025, 7:54 PM Wesley Piard ***@***.***> wrote:
This is still causing problems for me, too.
—
Reply to this email directly, view it on GitHub
<#650 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BKT2MLNVU4PWVJEZ5VNE6ZD2MPMYFAVCNFSM6AAAAABRLZVGH2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMJUGA3DKMRQG4>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
I am running actions on a self-hosted runner and my
$HOME/.gitconfig
is symlinked somewhere else (thanks to https://github.com/anishathalye/dotbot). When I run github actions, I see that the following lines have been added to my gitconfig.I tracked this down to several lines in the self-hosted runner logs:
It seems that when the checkout action copies
$HOME/.gitconfig
to temporarily modify it, it copies the symlink and so the changes propagate to the main file as well.This is a big issue because the updated .gitconfig cannot push or pull any of my repos. So I have to constantly go back and edit the ~/.gitconfig to fix this problem.
The text was updated successfully, but these errors were encountered: