broad-zoo-34077
04/28/2022, 11:43 AMbusy-agent-35515
04/28/2022, 12:00 PMhelpful-france-46557
04/28/2022, 12:13 PMbusy-agent-35515
04/28/2022, 12:17 PM--gitlab-server-url $CI_SERVER_URL
flag in infracost comment
command to use its API.helpful-france-46557
04/28/2022, 12:17 PMbusy-agent-35515
04/28/2022, 12:21 PMapi
scope for the token, right?helpful-france-46557
04/28/2022, 12:22 PMbusy-agent-35515
04/28/2022, 12:22 PMbusy-agent-35515
04/28/2022, 12:28 PMecho $GITLAB_TOKEN | md5sum
busy-agent-35515
04/28/2022, 12:30 PMbusy-agent-35515
04/28/2022, 12:33 PMcurl
with your token and make a direct API request. Let me prepare the command for you.busy-agent-35515
04/28/2022, 12:37 PMcurl -X POST --header "PRIVATE-TOKEN: [token]" --data-urlencode "body=test" <https://gitlab.com/merge_requests/[MR> number]/notes
This will create a new comment on your merge request. I would think if you run it locally, it should work fine, but if you run it in CI, it would fail.helpful-france-46557
04/28/2022, 12:54 PMbusy-agent-35515
04/28/2022, 12:54 PMhelpful-france-46557
04/28/2022, 12:55 PMbusy-agent-35515
04/28/2022, 12:56 PMhelpful-france-46557
04/28/2022, 1:01 PMbusy-agent-35515
04/28/2022, 1:02 PMcurl -X POST --header "PRIVATE-TOKEN: abc" --data-urlencode "body=test" <https://gitlab.com/api/v4/projects/test%2Frepo/merge_requests/1/notes>
abc - is the value of the token
test%2Frepo - should be your repo name in form namespace/project name with encoded slash character
1 - number of the merge requestbusy-agent-35515
04/28/2022, 1:03 PMPRIVATE-TOKEN
is the name of the header, so you need to keep it as --header "PRIVATE-TOKEN: $GITLAB_TOKEN"
busy-agent-35515
04/28/2022, 2:28 PMbusy-agent-35515
05/02/2022, 11:29 AM