I am trying to use code report insights,
I follows the docs,and I added this to the pipeline
script:
- >
curl --request PUT 'http://api.bitbucket.org/2.0/repositories/$BITBUCKET_REPO_OWNER/$BITBUCKET_REPO_SLUG/commit/$BITBUCKET_COMMIT/reports/mysystem-002' \
--header 'Content-Type:application/json' \
--data-raw '{ "title": "Security scan report",
"details": "This pull request introduces 10 new dependency vulnerabilities.",
"report_type": "SECURITY",
"reporter": "mySystem",
"link": "http://www.mysystem.com/reports/001",
"result": "FAILED" }'
however, it does not work
` % Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 291 0 0 100 291 0 32333 --:--:-- --:--:-- --:--:-- 32333 `
Hi @Hudhayfah,
I think there are two issues with the API call you are making:
1. You are not providing any authentication credentials or token in the API call.
You can use either OAuth, or Bitbucket username + app password. You can take a look at the following page and if you have any questions please feel free to let me know:
2. You will need to remove the quotes from the url, so instead of
'http://api.bitbucket.org/2.0/repositories/$BITBUCKET_REPO_OWNER/$BITBUCKET_REPO_SLUG/commit/$BITBUCKET_COMMIT/reports/mysystem-002'
use
http://api.bitbucket.org/2.0/repositories/$BITBUCKET_REPO_OWNER/$BITBUCKET_REPO_SLUG/commit/$BITBUCKET_COMMIT/reports/mysystem-002
Otherwise, the variables in the URL won't get replaced with their actual values.
Please feel free to let me know how it goes and if you need further help.
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.