Skip to content

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

Open
@some-natalie

Description

@some-natalie

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. ✨

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions