This is piece of my yaml file about ssh for gitlab ci:
eval $(ssh-agent -s)
echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
mkdir -p ~/.ssh
chmod 700 ~/.ssh
'[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
When I attempted to set SSH_PRIVATE_KEY variable to protected state, it occurs error:
Error loading key "(stdin)": invalid format
and I don't know why it's okay when I set SSH_PRIVATE_KEY variable to unprotected state