How can I automatically post Codefresh build results to pull requests in Bitbucket?
One could update the build status in bitbucket as follows:


  Adding a build result to a commit
  
  To associate a build result with a particular commit, you need to POST
  a JSON object to the build status REST resource at:
  
  https://&lt;bitbucket-base-url&gt;/rest/build-status/1.0/commits/&lt;commit-hash&gt;
  
  The format of the JSON object that should be used as the request body
  is:

{
    "state": "&lt;INPROGRESS|SUCCESSFUL|FAILED&gt;",
    "key": "&lt;build-key&gt;",
    "name": "&lt;build-name&gt;",
    "url": "&lt;build-url&gt;",
    "description": "&lt;build-description&gt;"
}



One could run such a snippet by codefresh at the end of the build using a script to notify bitbucket regarding the build status of a commit.


  One green build
  
  The following curl command will add a build to the commit
  9e72f04322c4a1f240e0b3158c67c3c19cdd16e7:

curl -u username:password -H "Content-Type: application/json" -X POST
http://localhost:7990/bitbucket/rest/build-status/1.0/commits/9e72f04322c4a1f240e0b3158c67c3c19cdd16e7
-d @build0.json

  
  Where build0.json contains:

{
    "state": "SUCCESSFUL",
    "key": "REPO-MASTER",
    "name": "REPO-MASTER-42",
    "url": "https://bamboo.example.com/browse/REPO-MASTER-42",
    "description": "Changes by John Doe"
}