I am trying to push a file to GH repo from pipeline and failing at ssh-add $private_key / ssh-add <(cat git-private-key | base64 --decode)
git config --global user.name "CI Bot"
git config --global user.email "localhost"
eval $(ssh-agent -s)
echo -e $private_key | base64 -w0 > git-private-key
ssh-add <(cat git-private-key | base64 --decode)
I tried other solutions and things like eval ssh-agent, update libcrypto, chmod 600 file permission, and passing key in plane and base64 format, but I am getting the same error.


After some debugging I have it fixed by correcting the way it is being referenced in
ssh-add.I have used sed to update the $private_key before
ssh-addThis makes sure that private_key will have a correct format earlier
After sed command