Open orhun opened 10 months ago
We need to change the logic to get the user from the pr, not from the commit, get the pr number from the commit should be straightforward.
"number": 1347,
"state": "open",
"locked": true,
"title": "Amazing new feature",
"user": {
"login": "octocat",
https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#list-pull-requests
That actually makes sense!
Describe the issue
The current approach to associate commits with the pull requests is the following:
merge_commit_sha
of the pull request matches the SHA of the commit.This poses a couple of problems when the pull request is not squashed but rebased.
Take #360 for example (it is rebased).
git cliff -c github
outputs:However, it should be:
Additional context
I don't know how to fix this yet since it is the limitation of the data we get from the GitHub API. In the perfect world,
/commits
endpoint would also return the associated pull request number so that we don't need to fetch the pull requests and do some hacky comparison.Alternatively, we could use
<commit>/pull
API but that just means sending a request for each commit which adds up to a lot.