Link releases with commit #24362
-
Hi I am trying to find all the merge commits that were done on our master branch. I am correlating this to our release tags that we generate. I cannot seem to find the link between the release object and the commit object. I am using the following apis to get the two data types api/v3/repos/{repo}/releases api/v3/repos/{repo}/commits Any suggestions on what I am doing wrong? If I go to the UI and click on the release tag it shows the commit sha (short version) on the UI so I assume it is possibly to link the two. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
Hello @mattgolding and welcome to the community. GitHub Releases are always tied to git tags rather than specific commits, even though tags themselves refer to specific commits. So, in order to find the commit that a release refers to, you have to first find the tag the release is linked to and then find the commit the tag is linked to. For example:
Notice that the
And I hope that helps! |
Beta Was this translation helpful? Give feedback.
-
Thanks @lee-dohm exactly what I was after. One more on the same topic. Is there a way to get the commits that happened between 2 release tags ? Or would I have to get the commit against each release as you showed above and then you those 2 commit sha’s to see whats in between those ? |
Beta Was this translation helpful? Give feedback.
-
mattgolding:
Yes, you can by using the compare API call. For example:
I hope that helps! |
Beta Was this translation helpful? Give feedback.
-
Thanks @lee-dohm will give that a try. I thought that only compared between two commit ids but your example is using the release tags so will give that a try. Thanks |
Beta Was this translation helpful? Give feedback.
Hello @mattgolding and welcome to the community.
GitHub Releases are always tied to git tags rather than specific commits, even though tags themselves refer to specific commits. So, in order to find the commit that a release refers to, you have to first find the tag the release is linked to and then find the commit the tag is linked to. For example: