I have a sha1 of a git commit on GitHub and i need to understand to what branch that commit belongs through GitHub API.
For example we have this repo - https://github.com/mono/gtk-sharp/commits/master and example commit that isn't HEAD - GitHub API and UI
GitHub has a nice preview APIs there - https://developer.github.com/changes/2019-04-11-pulls-branches-for-commit/ and here but they are working only for commit that is a HEAD so i can't use it.
GitHub also has some kind of internal API for that as in UI that information is displayed here on screenshot below. I can get that data from https://github.com/mono/gtk-sharp/branch_commits/3d0d5a9670c897d5353a99c67d519e9fc6dbcb8e but it's not official API and i can't normally use it with GitHub Token for private repositories.
It's also doable through git branch -r --contains <commmit>
but it requires to have that git repository locally and i can't use that approach.
I couldn't find anything for that in neither GitHub REST or GraphQL APIs so any ideas would be appreciated. I probably can get list of commits of all branches and then traverse them to find it but it would be too slow. Also there was older question here but maybe something changed in last 5 years.
Thanks.