Changelog api return failed message
Hi
I’m trying to use Changelog api of gitlab, as in the documentation stated the POST request must be like this:
curl -H "PRIVATE-TOKEN: $CI_API_TOKEN" -X POST "$CI_API_V4_URL/projects/$CI_PROJECT_ID/repository/changelog?version=$CI_COMMIT_TAG"
I pass CI_COMMIT_TAG too in case of using terminal :)
but every time I use this curl command via the command line (inside git directory) or via the pipeline with the following job
release_job:
needs:
- job: auto_release_notes
artifacts: true
image: registry.gitlab.com/gitlab-org/release-cli
stage: release
rules:
- if: '$CI_COMMIT_TAG =~ /^v?\d+\.\d+\.\d+$/'
script:
- apk add ca-certificates curl
- 'curl -H "PRIVATE-TOKEN: $CI_API_TOKEN" -X POST "$CI_API_V4_URL/projects/$CI_PROJECT_ID/repository/changelog?version=$CI_COMMIT_TAG"'
release:
tag_name: '$CI_COMMIT_TAG'
description: release_notes.md
name: 'Release $CI_COMMIT_TAG'
ref: '$CI_COMMIT_SHA'
the result is successful pipeline with failed message: {"message":"Failed to generate the changelog: The commit start range is unspecified, and no previous tag could be found to use instead"}
but if I mention the “from” and “to” keywords in curl command the result will be something that it should be
curl -kH "PRIVATE-TOKEN: $CI_API_TOKEN" -X POST "$CI_API_V4_URL/$CI_PROJECT_ID/repository/changelog?version=v1.0.0&from=f4c5f33ce88&to=c7f62db399da3"
is there anything that I missed?
Thanks for taking the time to be thorough in your request, it really helps!