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

Key isn't removed after job is done #129

Closed
BRA1L0R opened this issue Sep 5, 2022 · 4 comments · Fixed by #171
Closed

Key isn't removed after job is done #129

BRA1L0R opened this issue Sep 5, 2022 · 4 comments · Fixed by #171

Comments

@BRA1L0R
Copy link

BRA1L0R commented Sep 5, 2022

After the job is done the ssh key persists in the self-hosted runner and eventually the keys build up into a larger and larger file. This also conflicts with other repo's runners.

@mpdude
Copy link
Member

mpdude commented Sep 6, 2022

Does this only affect the SSH config file, or also the .gitconfig?

@BRA1L0R
Copy link
Author

BRA1L0R commented Sep 6, 2022

Does this only affect the SSH config file, or also the .gitconfig?

I don't know as I switched to running a separate container for each runner.

@bfontan
Copy link

bfontan commented Dec 19, 2022

I'm having this same issue. I can confirm that in fact this affects both .gitconfig and ~/.ssh/config. Also there's no cleanup of the key files that keeps generating in the ~/.shh directory. As mentioned in #106 known_host file keeps growing with each run in the self-hosted runner.

It's also an issue to keep the .gitconfig keys, since the ssh runner stopped, the references in this file are no longer valid and git raises an git@github.com: Permission denied (publickey) error whenever I try to clone the repository manually afterwards; although it seems that this could be fixed by running the runner in a dedicated user.

Should this kind of cleanup be done after the action is finished?

@cardoe
Copy link

cardoe commented Mar 7, 2023

I was experiencing this as well. I ended up writing a compatible action available here: https://github.com/marketplace/actions/ssh-agent-deploy-key

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

Successfully merging a pull request may close this issue.

4 participants