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

import of .gitconfig on self-hosted runner causing git fetch failure #1724

Open
twojstaryzdomu opened this issue May 12, 2024 · 0 comments
Open

Comments

@twojstaryzdomu
Copy link

twojstaryzdomu commented May 12, 2024

The checkout action, running on a self-hosted runner, is failing to import additional files referenced within .gitconfig. My case is as follows, the config_github file which specifies the user and the key is not copied across into the environment, causing the job to fail to read from the repo.

Now, when not on self hosted, the above isn't happening. Can we forgo importing the .gitconfig altogether or be able to specify a list of additional local files, like ~/.ssh/config_github and ~/.ssh/id_rsa_github to be imported into the self-hosted runner?

# cat ~/.gitconfig 
<snip>
[core]
  sshCommand = "ssh -F ~/.ssh/config_github"

# cat ~/.ssh/config_github
Host github.com github g
  HostName github.com
  User git  
  IdentityFile ~/.ssh/id_rsa_github

The error related to the failure:

##[endgroup]
Copying '/home/pi/.gitconfig' to '/misc/githubrunner/_work/_temp/a98c99b5-92ca-4c31-992c-ec1bd888e283/.gitconfig'
<snip>
##[group]Fetching the repository
[command]/usr/bin/git -c protocol.version=2 fetch --prune --no-recurse-submodules origin +refs/heads/*:refs/remotes/origin/* +refs/tags/*:refs/tags/*
Can't open user config file /misc/githubrunner/_work/_temp/a98c99b5-92ca-4c31-992c-ec1bd888e283/.ssh/config_github: No such file or directory
##[error]fatal: Could not read from remote repository.
@twojstaryzdomu twojstaryzdomu changed the title import of .gitconfig on self-hosted runner causing failures import of .gitconfig on self-hosted runner causing git fetch failure May 12, 2024
@actions actions deleted a comment May 16, 2024
@actions actions deleted a comment May 16, 2024
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

2 participants
@twojstaryzdomu and others