Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Pull request pipelines not running after a pull request is open

Alberto Pellizzon
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 9, 2019

Hello, I am trying to use the new feature described here which allows me to trigger pipelines on pull requests.

I have set up my bitbucket-pipelines.yml as following

 

definitions: 
services:
elasticsearch: # es definition
mysql: # mysql definition
steps: &test
services:
- elasticsearch
- mysql
image: node
name: Test
caches:
- node
script:
- npm install
- NODE_ENV=test npm run test_ci

pipelines:
pull-requests:
master:
- step: *test
develop:
- step: *test
branches:
master:
- step: *test
- step: # deploy step
develop:
- step: *test
- step: # deploy step

With this i want to run a pipeline every time a PR is open onto master or develop.

Still I am not able to see any pipeline running for my PRs.
They only run when i push directly on develop / master (as definied in branches) or after the PR is merged.

 

Did i forget something ?

1 answer

1 accepted

1 vote
Answer accepted
Steven Vaccarella
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 13, 2019

Hi Alberto,

The pull request pipelines are matched against the source of the pull request, not the destination. If you want to match against all source branches, you can use '**' (including quotes) as the pipeline key, eg:

pipelines:
pull-requests:
'**':
- step: *test

Unfortunately there is currently no way to match against the destination branch. As an alternative you can check the value of the BITBUCKET_PR_DESTINATION_BRANCH variable within your build script and exit the build immediately if it is not equal to "master" or "develop".

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events