Since Github API didn't support get the branch contains commit (SHA) yet. So I found we can get the branch if we can parse HTML from URL https://github.com/:org/:repo/branch_commits/:sha. But currently, I can't connect to this URL (for a private repo) even though I have the credentials
const url = `https://github.com/${org}/${repo}/branch_commits/${hash}`;
const options = {
method: 'GET',
uri: url,
headers: {
"Authorization": token,
}
};
request(options).then(result => {
console.log(result);
}).catch(err => {
console.log(err);
});
The result is 404 Not Found
.
Does anyone have an idea here?
Thanks!!