In past you could in most cases just add blob/master/ to a github url get the raw file, i.e.
https://github.com/jacoco/jbang-catalog/blob/master/jbang-catalog.json`
Now with old repos using master
but new using main
that trick don't work on new repos.
Is there a way to avoid having to do a call to the rest api to find default branch main ?
like a magic marker like blob/@default/
or similar ?
One solution is to use HEAD
. That symbolic name will give you tip of the default branch no matter what its name is.
If you prefer it to redirect to the default branch then instead use -
for example https://github.com/jacoco/jbang-catalog/blob/-/jbang-catalog.json
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With