For certain PR pipelines I'd like to not run them if the PR is marked as draft.
Is there a way to do this?
Hi! I'm the engineer that oversaw the draft feature and we don't explicitly expose the draft status in the pipeline. As said above, you could make an API call inside your pipeline to check the draft status, but this wouldn't rebuild when the PR transitions from open to draft. So you would need to be careful about making sure builds re-run after the transition.
You could call Bitbucket API inside the pipeline and check if draft is true, and then not proceed/exit in your pipeline script.
It would still trigger the pipeline though, and after you mark your PR as non-draft, you will likely want to build it. However, I haven't checked it, but it won't be trigger automatically, you will need to push to force a build of your PR.
We provide a Bitbucket Cloud app, Flowie, which you can configure it not trigger pipelines based on certain conditions of the PR. You can use Flowie's draft workflow feature based on labels to achieve what you want. An as soon as the conditions change, say you mark PR as non-draft it will trigger the build.
We don't support Bitbucket built in draft yet, as it was recently released, but it should be added soon, if you prefer it over Flowie's draft support.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.