unjs / ungh

🐙 Unlimited access to github API
https://ungh.cc
MIT License
514 stars 12 forks source link

feat: add `defaultBranch` and use it for `readme` endpoint #49

Closed tmg0 closed 1 year ago

tmg0 commented 1 year ago

Add default branch filed in GithubRepo interface.

Get readme from default branch if there is not a branch query.

pi0 commented 1 year ago

Thanks for PR and sorry it took long! It was an important fix.

I have rebased your PR and also reimplemented to always pick default branch. Supporting via query params can be tricky for caching.