question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Checkout breaks symlinked gitconfig on self-hosted runner

See original GitHub issue

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.

[http "https://github.com/"]
    extraheader = AUTHORIZATION: basic *** [it was a token]
[url "https://github.com/"]
    insteadOf = git@github.com:
    insteadOf = org-45189381@github.com:

I tracked this down to several lines in the self-hosted runner logs:

2021-12-04T01:29:22.8379527Z Switched to a new branch 'main'
2021-12-04T01:29:22.8380661Z Branch 'main' set up to track remote branch 'main' from 'origin'.
2021-12-04T01:29:22.8382186Z ##[endgroup]
2021-12-04T01:29:22.8383552Z ##[group]Setting up auth for fetching submodules
2021-12-04T01:29:22.8385435Z Copying '/home/user/.gitconfig' to '/home/user/.local/share/actions-runner/_work/_temp/1ccda36a-b42c-42b0-9664-29b4f1e31ba3/.gitconfig'
2021-12-04T01:29:22.8396391Z Temporarily overriding HOME='/home/user/.local/share/actions-runner/_work/_temp/1ccda36a-b42c-42b0-9664-29b4f1e31ba3' before making global git config changes
2021-12-04T01:29:22.8398638Z [command]/usr/bin/git config --global http.https://github.com/.extraheader AUTHORIZATION: basic ***
2021-12-04T01:29:22.8427546Z [command]/usr/bin/git config --global --unset-all url.https://github.com/.insteadOf
2021-12-04T01:29:22.8451850Z [command]/usr/bin/git config --global --add url.https://github.com/.insteadOf git@github.com:
2021-12-04T01:29:22.8473658Z [command]/usr/bin/git config --global --add url.https://github.com/.insteadOf org-45189381@github.com:
2021-12-04T01:29:22.8494913Z ##[endgroup]
2021-12-04T01:29:22.8496341Z ##[group]Fetching submodules
2021-12-04T01:29:22.8497466Z [command]/usr/bin/git submodule sync --recursive

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.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

1reaction
beingminimalcommented, Jun 29, 2022

This Issue is open since last 7 months and @msdrigg has already submitted PR for the same and awaiting for review and merge. It’s an humble request to look into this issue and merge the changes. @thboop @TingluoHuang Due to this issue, we are not able to setup Github Self hosted runner in our local environment. So for us it is blocker.

0reactions
msdriggcommented, Apr 2, 2022

I made a pr but they dont seem too interested

Read more comments on GitHub >

github_iconTop Results From Across the Web

Git symbolic links in Windows - Stack Overflow
In the end, I chose this approach to create a symlink-out folder and create the symbolic links to where the original file used...
Read more >
git-config Documentation - Git
gitconfig is used to store a per-user configuration as fallback values for the .git/config file. The file /etc/gitconfig can be used to store...
Read more >
Troubleshooting Omnibus GitLab installation issues
This error is thrown when /etc/gitlab/gitlab.rb configuration file contains configuration that is invalid or unsupported. Double check that there are no typos ...
Read more >
Methods — conan 1.53.0 documentation
Git (folder="hello") # git.clone("https://github.com/conan-io/hello.git") ... Maybe the only setting that makes sense is the OS self.settings.os , if not ...
Read more >
Creating Your Own Git Server | g.p. anders
Ever considered setting up and running your very own git server? ... steps I took to set up my own so that you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found