Key isn't removed after job is done
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.
Does this only affect the SSH config file, or also the .gitconfig?
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.
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 [email protected]: 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?
I was experiencing this as well. I ended up writing a compatible action available here: https://github.com/marketplace/actions/ssh-agent-deploy-key