How do I compare two different tags in GitLab via the API?

Viewed 190

For release approval I need to email a list of changes between two tags on a branch.

Previously we used svn but have recently changed to git and GitLab.

When the branch is new it is easy as each release has a branch and a milestone so any Merge Request on that milestone can be picked up and displayed. There is a 1 to 1 mapping between milestones and branches.

However, if someone wants to upgrade the tag on the branch from say 5 to 10. I need to provide a list of Merge Requests which have gone into the branch.

I do not need them displayed on a webpage or extracted via the GUI. I need to do it via the API as the information is collated by another application automatically.

How can I use the Gitlab API to generate a list of Merge Requests which have been merged in between two specified tags?

1 Answers

You can make use of repositories compare api for this purpose.

It should be something like.

api/v4/projects/PROJECTID/repository/compare?from=tag_v1&to=tag_v2
Related