Skip to content
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

Moving the .gitconfig file from the runner host into the working directory doesn't follow symlinks #1706

Open
some-natalie opened this issue Apr 25, 2024 · 0 comments

Comments

@some-natalie
Copy link

My ~/.gitconfig file on my laptop is actually a symlink to a file that's managed in my dotfiles repository. I've been doing some local development and tried using my Mac laptop as a runner. More or less works alright. When the checkout job tries to move a symlink into the working directory, it breaks.

Here's the error (source workflow run):

Copying '/Users/natalie/.gitconfig' to '/Users/natalie/actions-runner/_work/_temp/ae6dedec-eb27-4878-834d-b00a2ed61f25/.gitconfig'
Temporarily overriding HOME='/Users/natalie/actions-runner/_work/_temp/ae6dedec-eb27-4878-834d-b00a2ed61f25' before making global git config changes
Adding repository directory to the temporary git global config as a safe directory
/usr/bin/git config --global --add safe.directory /Users/natalie/actions-runner/_work/kubernoodles/kubernoodles
Error: error: could not lock config file /Users/natalie/actions-runner/_work/_temp/ae6dedec-eb27-4878-834d-b00a2ed61f[25](https://github.com/some-natalie/kubernoodles/actions/runs/8838270646/job/24269180087#step:2:27)/.gitconfig: No such file or directory
Failed to initialize safe directory with error: Error: The process '/usr/bin/git' failed with exit code 255

Removing the symlink and copying the file from the dotfiles repository into ~/.gitconfig fixes this.

Seems like unexpected behavior given that using a dotfiles repository isn't uncommon. ✨

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant