Migrating from Github Actions to Bitbucket pipelines. We need to use dynamic pipelines to assign the task to self hosted runners.Is there a Bitbucket API to run the equivalent of below command ? (Or similar trick would work)
Hi @Ozan Kizildogan,
Bitbucket API endpoint for diff is called Compare two commits in the documentation.
The command you're referring to seems to be comparing a commit to its parent, i.e. simply shows the delta of that commit. The equivalent of this operation in terms of Bitbucket API would be the aforementioned endpoint with a spec argument represented by just that single commit.
For example:
https://api.bitbucket.org/2.0/repositories/atlassian/atlassian-spring/diff/48fb8a85d13c7d17f987dea2faec93636fbf8483
From your other post:
I have now another question about comparing the difference between the approved PR against main.
Note that the command you mentioned shows the diff only between the commit and its parent, not necessarily against the main branch of the repo, e.g. if the PR branch has more than one commit it will only show the delta of its tip commit. To get a diff against the main branch, assuming it is called master, add it to the spec like this:
https://api.bitbucket.org/2.0/repositories/atlassian/atlassian-spring/diff/48fb8a85d13c7d17f987dea2faec93636fbf8483..master
Hope this helps.
Cheers,Daniil
Thanks @Daniil Penkin for the prompt and kind reply.After trying the API as you suggested, I wasn't successful with the spec piece using the below:<hash>..<main>. ( we use main instead of master)However using the hash only for spec also helped.
It looks like you're new here. Sign in or register to get started.