From 56bfdfe0b6f0c3256dd7c841781c90f163965f08 Mon Sep 17 00:00:00 2001
From: Yen-Chen Chen <yen-chen.chen@tum.de>
Date: Thu, 27 Mar 2025 15:07:35 +0000
Subject: [PATCH] Set changelog search util current commit
 (icon-libraries/libiconmath!49)

## What is the new feature
Make a changelog API that searches for changelogs until the target commit. This way, we can manage the versions more easily.
## How is it implemented
In the GitLab [Changelog API](https://docs.gitlab.com/api/repositories/#generate-changelog-data), the default `from` attribute is the last tag, which is exactly what we wanted. The default `to` attribute is the latest commit at the default branch. We change it to the target commit where we create the tag.

Merged-by: Pradipta Samanta <samanta@dkrz.de>
Changelog: other
---
 .gitlab-ci.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 9837066..f328cf3 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -245,7 +245,7 @@ Prepare Changelog:
   script:
     - apk add curl jq
     # generate release note
-    - 'curl -H "PRIVATE-TOKEN: $CI_API_TOKEN" "$CI_API_V4_URL/projects/$CI_PROJECT_ID/repository/changelog?version=$CI_COMMIT_TAG" | jq -r .notes > release_notes.md'
+    - 'curl -H "PRIVATE-TOKEN: $CI_API_TOKEN" "$CI_API_V4_URL/projects/$CI_PROJECT_ID/repository/changelog?version=$CI_COMMIT_TAG&to=$CI_COMMIT_SHA" | jq -r .notes > release_notes.md'
   tags:
     # choose runner
     - alpine
-- 
GitLab