I’m writing some automation processes in c# (not really relevant) and I’ve been using the following URL format to fetch zip file from github:
https://<username>:<userotken>@github.com/<my company>/<repo>/zipball/beta
It works great! It downloads the zip file for a branch as advertised.
Right now, I’m downloading the whole zip file via my automation just to compare the commit hash to see if the code needs to be updated for it to be in sync with github remote repo. The zip file is kind of big and downloading it for just simple thing as the commit hash is an overkill – especially a few times a day.
The question is, is there anything I can put at the end of the url-above to download just the latest commit hash of a branch in json or string format? I know there is. I read about it a few months back but now I can’t find the post. Please note that I’m not using curl
(there are a lot of examples out there using curl
). The url-above works even if you cut and paste it into a browser. Is there a URI that I can append to it to just get the commit hash? Any help would be great.
I tried a few things based on various posts. I keep getting “Not Found”
1