Generalize bitbucket repository script to work for github as well