Hi,
I was using public repo and could do a :
curl -sL https://sonarcloud.io/api/qualitygates/project_status?projectKey=abcd …
{“projectStatus”:{“status”:“OK”,“conditions”:[{“status”:“OK”,“metricKey”:“new_lines_to_cover”,“comparator”:“GT”,“periodIndex”:1,“errorThreshold”:“0”,“actualValue”:“0”}],“periods”:[{“index”:1,“mode”:“days”,“date”:“2019-10-30T16:36:31+0100”,“parameter”:“30”}],“ignoredConditions”:false}}
But with a private repo I am not able to do that.
I tried with
curl -L -v -u mustafa.turabali:P****** https://sonarcloud.io/api/qualitygates/project_status?projectKey=abcd …
but not working , can you please help.
Julien Lancelot
can you assist?
benoit
(Benoit)
November 5, 2019, 4:39pm
3
Hi,
Please do not directly mention people. You won’t’ receive an answer faster by doing so.
As mentioned in the documentation , you have to create a token and use it as a replacement for your login in basic auth.
So it would be:
curl -L -v -u <your-token>: https://....
3 Likes
onomojo
(Brian McQuay)
May 8, 2020, 9:21pm
4
I’m using your curl command with a token and still having problems:
curl -L -v -u myToken: https://sonarcloud.io/api/qualitygates/project_status?projectKey=myProjectKey
I get the following
{"errors":[{"msg":"Component key 'myProjectKey' not found"}]}
Colin
(Colin)
May 9, 2020, 9:31am
5
You’ll need to define your organization
as a query parameter as well.
onomojo
(Brian McQuay)
May 9, 2020, 2:35pm
6
Thanks. Looks like the docs need updating. That param isn’t listed. https://sonarcloud.io/web_api/api/qualitygates/project_status
Colin
(Colin)
May 9, 2020, 3:12pm
7
Thanks for the heads up. I’ll ping around