Pipelines' YML file for Pull-Requests definitions

Issue #17873 wontfix
Leonardo Montiel staff created an issue

On the following documentation, it's defined that using the "pull-requests: '**'" definition will run Pipelines for every pull request created on the repository.

https://confluence.atlassian.com/bitbucket/configure-bitbucket-pipelines-yml-792298910.html#Configurebitbucket-pipelines.yml-ci_pull-requestspull-requests

However, if a pull request is created while having a source branch which does not include the "pull-requests: '**'" on the Bitbucket-pipelines.yml definition, the build is not triggered.

For example, lets suppose I have two branches, master and development, each with their YML set up like this: Screen Shot 2018-12-28 at 16.23.24.png

Screen Shot 2018-12-28 at 16.23.50.png

In this case, it's not clear which YML file should be considered during the creation of the pull request. I would assume, in this case, that the YML to be considered here is the one on the destination branch, which contains the following definition for pull requests:

pipelines:
  pull-requests:
    '**':

Creating the pull request, however, does not seem to trigger any builds: Screen Shot 2018-12-28 at 16.25.53.png

Comments (3)

  1. Aneita Yang staff

    Thanks for reaching out.

    This behaviour is by design. Pipelines runs based on the configuration specified in the bitbucket-pipelines.yml file on the branch that you push. Is there a reason why your YML configuration differs between branches? In the example that you've provided, creating a PR to merge the changes from the development branch to master will also change the contents of the YML file on master to no longer include pull-requests pipelines.

  2. Aneita Yang staff

    Pipelines that are defined for pull requests will run only if there is a pull request open from the branch specified, and based off the configuration specified in the bitbucket-pipelines.yml file on the branch where the changes are being pushed.

    I've answered the original Community question where this issue was created from. This issue captures a different problem to the Community post, so I'm going to mark this issue as won't fix.

  3. Log in to comment