I am trying to push to a GitHub repository from Jenkins using
git remote set-url origin git@github.com:$reponame.git
git checkout $branch
git add file
git commit -m "Add file"
git push origin $branch
However I am getting the error:
ssh: /opt/bitnami/common/lib/libcrypto.so.1.0.0: no version information available (required by ssh)
ssh: /opt/bitnami/common/lib/libcrypto.so.1.0.0: no version information available (required by ssh)
Host key verification failed.
All the answers I've seen for solving this recommend using the Git Publisher Post Build Step. I am not able to use Git Publisher as I have multiple SCM defined which are defined by the $reponame variable.
I tried looking at the output of git show-ref
and this shows the list of branches that are part of the GitHub repo.
I'm not sure how to solve the above errors, any help on this issue would be greatly appreciated.
UPDATE:
I've been able to successfully push, however the changes are not reflected on the GitHub branch. When I check GitHub the commit is not added to the branch. When I run the job again, the push returns "Everything up to date" implying that the branch that it pushed to already has those changes.
Where is this Git push pushing to? And why are the changes not reflected on the remote GitHub branch?