Hi,
if you have access to the variable value inside your CI job’s shell, you could for example use the REST API and modify the merge request comment (or add a new one to start with). This comment needs to include a Markdown formatted URL then. If you are more into buttons, font-awesome icons with HTML might also be possible, at least as long as GitLab itself uses these sets.
-
To get things started, try fetching the merge request ID inside the job e.g. with a simple
echo "Merge Request IID: $CI_MERGE_REQUEST_IID"… It should beCI_MERGE_REQUEST_IIDbut requires specific job tagging for only being run on merge requests then. https://docs.gitlab.com/ee/ci/variables/predefined_variables.html Please note that it isIIDand notID. -
Next, fetch the corresponding MR from the API via https://docs.gitlab.com/ee/api/merge_requests.html#get-single-mr - requires
CI_MERGE_REQUEST_IIDandCI_PROJECT_ID. -
Now take the description you’ve modified with the Markdown URL and update the MR at this endpoint: https://docs.gitlab.com/ee/api/merge_requests.html#update-mr This can be tricky, so keep in mind to always append to the text description in a new line. Test any sed or regex magic before in a separate editor.
Do this step by step, and post your results here please.
Cheers,
Michael