# Legacy project-based triggers

:::important[Legacy triggers]

This page is about legacy triggers that are defined on a project level. For new users, we strongly recommend using the target-based build triggers which are defined on the level of Workflows and Pipelines as they allow more flexibility in designing your triggers: [Configuring build triggers](/bitrise-ci/run-and-analyze-builds/build-triggers/configuring-build-triggers).

:::

## Creating project-based triggers

Project-based triggers are defined on the project level: that is, the top level of your configuration YAML file. The trigger defines which Workflow or Pipeline should run when a given code event happens. A single code event can only trigger a single build.

**Workflow Editor**

1. 1. Log in to Bitrise and select **Bitrise CI** on the left, then select your project.
1. Click the **Workflows** button on the main page.
1. On the left, select **Triggers**.
1. Find the **Legacy triggers** section.

   ![Legacy triggers section on the Triggers page](/img/run-and-analyze-builds/2026-07-14-legacy-triggers-section.png)
1. Select the trigger type and click the **Add trigger** button.

   For example, if you want to set up a trigger for pull request events, select the Pull Request tab and click the **Add pull request trigger** button.
1. Configure your trigger in the dialog.

   When setting multiple conditions, all conditions must be fulfilled for a build to start. You can use regular expressions for any of the condition types.

   You can find the full list of supported trigger conditions here: [Supported trigger conditions](/bitrise-ci/run-and-analyze-builds/build-triggers/configuring-build-triggers#supported-trigger-conditions).
1. When done, click **Add trigger**.

**Configuration YAML**

1. Open your configuration YAML file.
1. In the Workflow, find the `trigger_map` property and set up your trigger under it. You need:

   - A `type` property to define the type of the code event.
   - A trigger condition. For example, `commit_message`.
   - The Workflow or Pipeline you want to trigger.

   ```yaml
   trigger_map:
   - type: push
     commit_message: your_message
     workflow: my-workflow
   ```

   You can find the exact syntax for the different trigger types here: [YAML syntax for build triggers](/bitrise-ci/run-and-analyze-builds/build-triggers/yaml-syntax-for-build-triggers).
1. Save the configuration.

## Disabling a project-based trigger

To disable a project-based build trigger:

**Workflow Editor**

1. Open the Workflow Editor on Bitrise.
1. On the left, select **Triggers**.
1. Select the appropriate tab, depending on the trigger you want to deactivate.

   ![Legacy triggers tab with the Active checkbox on a trigger row](/img/run-and-analyze-builds/2026-07-14-legacy-triggers-active-checkbox.png)
1. Uncheck the **Active** checkbox to disable the trigger.

**Configuration YAML**

1. Open your configuration YAML file.
1. Find the `trigger_map` property and the trigger you want to disable.
1. Add `enabled: false` to it.

   ```yaml
   trigger_map:
   - type: push
     push_branch: main
     workflow: primary
     enabled: false
   ```

## Project-based trigger syntax

A project-based trigger has three main elements in its YAML syntax:

- The type of the trigger: `push`, `pull_request`, or `tag`.
- The trigger condition. For example, the source branch of a pull request.
- The Workflow or Pipeline to be triggered.

One trigger means one build: a single project-based trigger can only trigger a single Workflow or Pipeline. You can [chain Workflows together](/bitrise-ci/workflows-and-pipelines/workflows/managing-workflows#chaining-workflows-together) run several Workflows in succession from a single trigger.

Below is a single trigger that triggers a build with the `primary` Workflow when a pull request is opened from any branch.

```yaml
trigger_map:
- pull_request_source_branch: "*"  
  type: pull_request  
  workflow: primary
```

### Multiple matching triggers

For project-based triggers, the first trigger with matching conditions triggers a build. This means the order of the triggers is important:

```yaml
trigger_map:
- type: push
  push_branch: main
  workflow: primary
- type: push
  commit_message: deploy
  workflow: deploy
```

The first trigger triggers the `primary` Workflow if code is pushed to the `main` branch of the app's repository.

The second trigger triggers the `deploy` Workflow if a commit with the commit message `deploy` is pushed to any branch of the repository.

What happens when a commit is pushed to the `main` branch with the commit message `deploy`? The commit matches all conditions of the first trigger so the `primary` Workflow is triggered. In this scenario, the `deploy` Workflow is NOT triggered, even though the commit matches all conditions of that trigger, too.

### Multiple trigger conditions

If you define multiple trigger conditions in a single project-based trigger then all conditions have to match in order to trigger a build. For example:

```yaml
trigger_map:
- pull_request_target_branch: "main"
  pull_request_source_branch: "develop"
  type: pull_request
  workflow: primary
```

This will only select the `primary` workflow if the pull request’s source branch is `develop` AND the target branch is `main`.

## Project-based trigger components

The components listed on this page are valid for legacy, project-based triggers.

| Component | Description | Accepted values | Default value |
| --- | --- | --- | --- |
| `type` | Defines the type of a project-based trigger. A trigger with a given type only accepts trigger conditions belonging to that type. | - `push` - `pull_request` - `tag` | N/A |
| `enabled` | A boolean property that defines if the trigger is currently active. | - `true` - `false` | `true` |
| `workflow` or `pipeline` | The Workflow or Pipeline that is triggered. You can't set both. | The exact name of the Workflow or Pipeline. | N/A |

| Component | Description | Default value |
| --- | --- | --- |
| `push_branch` | The branch of the repository where code is pushed to trigger a build. | `*` |
| `commit_message` | The commit message to trigger a build. | `*` |
| `changed_files` | The path to a file or folder where changes should trigger a build. | `*` |

| Component | Description | Default value |
| --- | --- | --- |
| `pull_request_source_branch` | The branch of from which the pull request is opened. | `*` |
| `pull_request_target_branch` | The branch which is the merge target of the pull request. For a pull request in a GitHub stack, Bitrise matches this against the base branch of the stack. | `*` |
| `pull_request_label` | The pull request label. | `*` |
| `draft_pull_request_enabled` | A boolean property that defines if draft pull requests trigger builds. | `true` |
| `pull_request_comment` | A comment posted on a pull request. | `*` |
| `commit_message` | A specific commit message in pushes to a pull request. | `*` |
| `changed_files` | Specific files that are modified in a pull request. | `*` |

| Component | Description | Default value |
| --- | --- | --- |
| `tag` | The value of the tag. Accepts a string value or a `regex` property. | `*` |
