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
Navigate to your pipeline, then select Pipeline Settings
Open the Triggers tab and select New Trigger
Give the trigger a name and select your desired trigger options
Select Create
Your trigger will appear in the list.
Conditions
By default, all steps in your pipeline will run when triggered. You can limit pipeline step execution at runtime with conditions.
This pipeline runs the test step only for pull request events.
kind: pipeline
spec:
stages:
- type: ci
spec:
steps:
- name: test
type: run
when: build.event == "pull_request"
spec:
container: golang
script: |-
go build
go testThis pipeline runs the test step only for pull request created actions.
Last updated
Was this helpful?