Some commands for use in Circle CI config related to the task of getting GitHub's SSH keys into your known_hosts file.
Why is that useful? It's useful to me because I have some Circle
CI jobs where I create a new branch, push it back to GitHub and
create a PR. Without having a github.com entry in your known_hosts
file, the git push
would fail. I mean, really it would hang
waiting for user input with a prompt like:
The authenticity of host 'github.com (...)' can't be established.
RSA key fingerprint is [...].
Are you sure you want to continue connecting (yes/no)?
Anyway, here's a couple commands you can add to your Circle configs to help get GitHub into your known_hosts file without too much fuss.
You should add these in under the top-level commands
attribute
of your version 2.1 config.yml
. The version is important,
commands
was introduced in 2.1.
Oh... I guess this could be an orb 🤔