Gitlab Secret Variables and Carriage Returns
Just ran into this while setting up a Gitlab Deploy Runner and wanted to document it before I forget ;-)
If you use Secret variables in your Gitlab CI/CD and they happen to be multi line, such as a private key, then you might be wondering why you are being asked for a passphrase when you didn’t set one!
The issue is that multi line values are stored in DOS format, yep “\r\n” vs “\n” which assuming that your runner is UNIX, then ssh-add will want no part of it.
A quick fix is update you CI configuration to strip out the unwanted passenger. The good news is this will not cause any harm if the carriage returns are not there.