ssh-agent
ssh-agent copied to clipboard
SSH config cleanup not done
The modified git config is not cleaned up after a run, e.g. the url git@key-
section.
This will affect a subsequent run on, for example, a self-hosted runner.
We are using a workaround which may help someone:
- name: Restore git global config
if: always()
run: |
MATCH=$(grep -o 'git@key-[^"]*\.github\.com:.*/[^"]*' ~/.gitconfig)
git config --global --remove-section url.${MATCH}
@kcarlson would this workaround also work when multiple keys are provided?
I've only tested it with a single key being provided to the ssh-private-key
field. If multiple keys end up under the same section in the .gitconfig, it should work, otherwise, if there are multiple sections, MATCH will have multiple matches and the ´git config´ command will not work.
I also have this issue, any news?