Gitlab changelog API GET only picks up commits on `main`

,

I am developing a CI/CD workflow that uses the Gitlab Changelog POST API (Repositories API | GitLab).

Before calling the POST I am calling the corresponding GET (Repositories API | GitLab) to see if there’s anything to change. If it return “No changes” then I don’t call the POST.

The project has multiple production branches, so the relevant commits are not in the main. What I’m finding is that while the POST call does successfully picks up commits on the non-main branch with git trailers, and creates changelog entries for them, the GET ignores anything not on main. (Once I merge them into main then it does pick them up).

I can illustrate this with two sample projects. In the first (“Unmerged”, Stuart McGill / gitlab-changelog-unmerged · GitLab) I did the following:

  • Add tag 1.0.0 on main
  • Create my-branch
  • Add a commit with a git trailer

The Gitlab Changelog GET API (https://gitlab.com/api/v4/projects/45243437/repository/changelog?version=1.0.1) doesn’t pick up the change:

{"notes":"## 1.0.1 (2023-04-17)\n\nNo changes.\n"}

The only difference in the second project (“Merged”, Stuart McGill / gitlab-changelog-merged · GitLab) is that my-branch was merged into main.

  • Add tag 1.0.0 on main
  • Create my-branch
  • Add a commit with a git trailer
  • Merge my-branch

This time the Gitlab Changelog GET API (https://gitlab.com/api/v4/projects/45243954/repository/changelog?version=1.0.1) does pick up the change:

{"notes":"## 1.0.1 (2023-04-17)\n\n### changed (1 change)\n\n- [Update README (with a git trailer)](stueymcgill/gitlab-changelog-merged@e2dbbaf9aa6fe93b3b89479e7b872e4ddd0e6813) ([merge request](stueymcgill/gitlab-changelog-merged!1))\n"}

There is a branch option on the POST which I’ve been setting to the appropriate branch, but there’s no such option for the GET.

Does the GET API only work on the default branch, even though the POST works on any branch?