Github has good options for authorisation that don't require a password. Are there not any Github workflow that for example uses
https://help.github.com/articles/creating-an-access-token-for-command-line-use or http://developer.github.com/v3/oauth/#non-web-application-flow ?
Have you looked at those options ?