Skip to content

Commit 5898cb3

Browse files
committed
RHDEVDOCS 6348 PAC: matching a pipeline run to pull reqiuest labels
1 parent 37b1766 commit 5898cb3

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

modules/op-creating-pipeline-run-using-pipelines-as-code.adoc

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,34 @@ annotations:
7878
* Globs with pattern matching such as `"refs/heads/\*"`
7979
* Tags such as `"refs/tags/1.\*"`
8080

81+
[discrete]
82+
.Matching a pull request label to a pipeline run
83+
84+
// Note for reviewers: passive voice unfortunately seems to be necessary in the following paragraph. A label can be added to a pull request by an automated system as well as a user, so there is no subject to mention. The same applies to updating the PR with a new commit
85+
86+
You can match a pipeline run to one or several pull request labels. {pac} starts the pipeline run when any of these labels is added to a pull request. When the pull request is updated with a new commit, if the pull request still has the label, {pac} starts the pipeline run again.
87+
88+
You can use the following example to match the `pipeline-bug-or-defect` pipeline run when either the `bug` label or the `defect` label is added to a pull request, and also when a pull request with this label is updated with a new commit:
89+
90+
[source,yaml]
91+
----
92+
apiVersion: tekton.dev/v1
93+
kind: PipelineRun
94+
metadata:
95+
name: pipeline-bug-or-defect
96+
annotations:
97+
pipelinesascode.tekton.dev/on-label: "[bug, defect]"
98+
# ...
99+
----
100+
101+
[NOTE]
102+
====
103+
The current version of {pac} supports matching events to pull request labels only for the GitHub, Gitea, and GitLab repository hosting service providers.
104+
====
105+
106+
:FeatureName: Matching pull request labels a pipeline run
107+
include::snippets/technology-preview.adoc[]
108+
81109
[discrete]
82110
.Matching a comment event to a pipeline run
83111

0 commit comments

Comments
 (0)