Skip to content

Instantly share code, notes, and snippets.

@codedge
Last active February 15, 2019 16:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codedge/b5481a22897f6682bccf301333ffbbb6 to your computer and use it in GitHub Desktop.
Save codedge/b5481a22897f6682bccf301333ffbbb6 to your computer and use it in GitHub Desktop.
[Gitlab CI]

Problem with ssh key and new lines

Generate your ssh private key with base64 encoding

$ cat my_private_key | base64 -w 0 

Use the encoded version as Gitlab CI env variable and decode like so:

$ ssh-add <(echo "$SSH_PRIVATE_KEY" | base64 -d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment