> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/open-source/use-harness-open-source/pipelines-1/triggers.md).

# Triggers

When code is pushed to a repository, a pull request is opened, or a tag is created, Harness Open Source can automatically trigger pipeline execution.

When creating a pipeline, Harness Open Source automatically creates a default trigger for you. You can customize this trigger, or create additional triggers.

## Create a trigger <a href="#create-a-trigger" id="create-a-trigger"></a>

1. Navigate to your pipeline, then select **Pipeline Settings**
2. Open the **Triggers** tab and select **New Trigger**
3. Give the trigger a name and select your desired trigger options
4. Select **Create**

Your trigger will appear in the list.

## Conditions <a href="#conditions" id="conditions"></a>

By default, all steps in your pipeline will run when triggered. You can limit pipeline step execution at runtime with [conditions](/open-source/use-harness-open-source/pipelines-1/conditions.md).

{% hint style="info" %}
Harness Open Source supports multiple pipelines per repository. Creating a pipeline per trigger event (push, pull request, tag) can reduce the need for conditions.
{% endhint %}

This pipeline runs the `test` step only for pull request [events](https://github.com/iKettles/harness-gitbook/tree/main/open-source/use-harness-open-source/reference/pipelines/expression_variables.md#buildevent).

```yaml
kind: pipeline
spec:
  stages:
  - type: ci
    spec:
      steps:
      - name: test
        type: run
        when: build.event == "pull_request"
        spec:
          container: golang
          script: |-
            go build
            go test
```

This pipeline runs the `test` step only for pull request created [actions](https://github.com/iKettles/harness-gitbook/tree/main/open-source/use-harness-open-source/reference/pipelines/expression_variables.md#buildaction).

```yaml
kind: pipeline
spec:
  stages:
  - type: ci
    spec:
      steps:
      - name: test
        type: run
        when: build.action == "pullreq_created"
        spec:
          container: golang
          script: |-
            go build
            go test
```
