Hi,
I am trying to create a new release using the API, with the contents of my CHANGELOG.md file rendered within the description and sent via JSON POST request. I aim to do this via a curl statement within a release job in .gitlab-ci.yml.
Prior to this, I have successfully embedded a link to the changelog file within the release note description using markdown syntax, e.g. [Changelog](CHANGELOG.md)
. However my question relates to rendering the contents of the file within the release note description.
For now, I am sending the JSON POST request via the RESTED Client and copying the Changelog file contents into the description attribute of the JSON POST request.
The release is created and I can view it at the project’s release page. Unfortunately new lines are not rendered. Following, this I have tried escaping the \r and \n characters within the description attribute of the post request, e.g.:
{"id":"<project_id>","name":"Release 1.0.0","tag_name":"v1.0.0","description":"desc\\r\\ntest"}
The release note is created but the description is rendered as desc\r\ntest. I have also tried this with:
{"id":"<project_id>","name":"Release 1.0.0","tag_name":"v1.0.0","description":"desc\\ntest"}
which rendered as desc\ntest.
To eliminate the RESTED Client as the source of the issue I have also tried sending a POST request via curl:
curl --header "Content-Type: application/json" --header "PRIVATE-TOKEN: my access token" --request POST --data '{"id":"projectid","name":"release 1.0.0","tag_name":"v1.0.0","description":"test\\r\\ndescription"}' https://gitlab.com/api/v4/projects/projectid/releases
How do I get GitLab to render a line feed/carriage return in a release note that has been created using the API?