Hi,
I'm trying to set my SSH private key as a secret variable of my repository. The SSH key is in this format
-----BEGIN OPENSSH PRIVATE KEY-----
AAAAAAAAAAAAAAAAAAAAA....
AAAAAAAAAAAAAAAAAAAAA....
....
-----END OPENSSH PRIVATE KEY-----
The key doesn't register correctly because (I think) it spans across multiple lines and BitBucket only supports single line variables (again, I think).
I'm not sure if I'm missing something obvious, but can I use my ssh private key as a secret variable?
Currently I'm using a workaround which is to base64 encode it
cat ~/.ssh/id_rsa | base64
and then use that string as the private variable. However, there's a big issue with this approach: someone can make a new sneaky commit when I don't notice and steal my private key by adding this line to the pipeline
echo $PRIVATE_KEY_B64 | base64 --decode
Thanks,
Mike