If you are using bamboo spec yaml.
You can use the option for-pull-request:
it will run every time a pull request is created or updated.
version: 2
plan:
project-key: PROJ
key: TASK1
name: TASK
description: You description
master-branch: develop
...
branches:
create:
for-pull-request:
accept-fork: true
This is an example of a Bamboo plan configuration written in YAML format.
The version
field indicates the version of the YAML syntax being used for this file.
The plan
section describes the basic information about the Bamboo plan. It includes:
project-key
and key
fields, which are used to identify the plan within the Bamboo project.
name
and description
, which are used to display the name and description of the plan within Bamboo.
master-branch
, which specifies the default branch used for the plan.
The branches
section contains settings for branch behaviors:
create
creates new branches.
for-pull-request
is a specific branch matching pattern that accepts pull request builds.
accept-fork
allows for forks of repositories to be built automatically.
These settings will configure how your Bamboo pipeline treats branches when they are created or updated.