I want to get the version/tag where the changes of merged PR were reflected. To get that I tried constructing commits tree for the master branch using git API repos/:owner/:name/commits?sha=<MASTER_SHA>
.After constructing tree, I will map all the found version/tag to commits in the tree. All the unmapped intermediate node are assigned version/tags according to versions they lie between. Once I have all the commits of master branch with versions, I try to locate merged PRs in the tree. This will help me map the PR to version. Is this optimal strategy? Or is there any another strategy to get PR to version mapping.
Asked
Active
Viewed 292 times
0

Ankush K
- 334
- 3
- 13
-
You can just use the list tags API https://developer.github.com/v3/repos/#list-tags. This will have the tags to commit SHA mapping, which would point to the PR merge commit. – Madhu Bhat Jul 25 '19 at 09:02
-
What about the PR which is merged with no version change? How will I be able to find versions for such PRs? It can be solved if there is any direct way to map PR to version(Not version to PR). Correct me if I am wrong. – Ankush K Jul 25 '19 at 10:03