I have to fetch all new commits that were a part when a new tag was created on a Git repo. This needs to be done through GitHub API.
For example the Git UI says Tagging Tag1 and has a sha associated with it... let's say the sha is : SHA1
Now how do I get all commits which happened or were a part of Tag1 through GitHub API? I want to store all these commits and perform some analysis on them.
Based on the clarification on your comment:
I want to get all commits between this newly created tag and previous tag
1. Get all the tags in a given repo, so you can get the current and the previous tag names
curl -X "GET" "https://api.github.com/repos/:owner/:repo/tags" \
-H "Authorization: token YOUR_GITHUB_ACCESS_TOKEN"
2. Get all the commits between the latest 2 tags
curl -X "GET" "https://api.github.com/repos/:owner/:repo/compare/:tag_1...:tag_2" \
-H "Authorization: token YOUR_GITHUB_ACCESS_TOKEN"
Doc links:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With