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 ?
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".
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.