How do I solve a vulnerability using a Pull Request (PR) in the API?

  • 17 January 2023
  • 0 replies
  • 62 views

Assume we have a repository with loads of vulnerabilities. It will take time to go through each one of them and potentially fix them. Luckily, Debricked offers the ability to open a pull request where it tries to solve as many vulnerabilities as possible at once.

 

Using the API

Endpoints:

/api/{version}/open/repository/{repositoryId}/pull-request/branch/{branchId}/{notify}/{includeUnaffected}

/api/{version}/open/repository/{repositoryId}/get-branches

We can generate a new bulk pull request for the repository, with ID 15707 in this case (shown in the URL). We can find the branch ID using the get-branches endpoint.

 

Example: First, we get the branch ID

curl -X 'GET' \

  'https://debricked.com/api/1.0/open/repository/15707/get-branches' \

  -H 'accept: */*' \

  -H 'Authorization: Bearer <token>

 

then, we create a new pull request on branch ID 2, enabling notification, not including unaffected dependencies in the PR.

curl -X 'GET' \

  'https://debricked.com/api/1.0/open/repository/15707/pull-request/branch/2/1/0' \

  -H 'accept: */*' \

  -H 'Authorization: Bearer <token>

 

 

 


0 replies

Be the first to reply!

Reply