You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/content/docs/guide/authoringprs.md
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,7 +53,7 @@ check out the code that is being tested.
53
53
| event_type | The event type (eg: `pull_request` or `push`) |`{{event_type}}`| pull_request (see the note for GitOps Comments [here]({{< relref "/docs/guide/gitops_commands.md#event-type-annotation-and-dynamic-variables" >}}) ) |
54
54
| git_auth_secret | The secret name auto-generated with provider token to check out private repos. |`{{git_auth_secret}}`| pac-gitauth-xkxkx |
55
55
| headers | The request headers (see [below](#using-the-body-and-headers-in-a-pipelines-as-code-parameter)) |`{{headers['x-github-event']}}`| push |
56
-
| pull_request_number | The pull or merge request number, only defined when we are in a `pull_request` event type. |`{{pull_request_number}}`| 1 |
56
+
| pull_request_number | The pull or merge request number, only defined when we are in a `pull_request` event or push event occurred when pull request is merged.|`{{pull_request_number}}`| 1 |
57
57
| repo_name | The repository name. |`{{repo_name}}`| pipelines-as-code |
58
58
| repo_owner | The repository owner. |`{{repo_owner}}`| openshift-pipelines |
59
59
| repo_url | The repository full URL. |`{{repo_url}}`| https:/github.com/repo/owner |
@@ -67,6 +67,11 @@ check out the code that is being tested.
67
67
| trigger_comment | The comment triggering the PipelineRun when using a [GitOps command]({{< relref "/docs/guide/running.md#gitops-command-on-pull-or-merge-request" >}}) (like `/test`, `/retest`) |`{{trigger_comment}}`| /merge-pr branch |
68
68
| pull_request_labels | The labels of the pull request separated by a newline |`{{pull_request_labels}}`| bugs\nenhancement |
69
69
70
+
Note: When using the `{{ pull_request_number }}` variable in a push-triggered PipelineRun when a pull request is merged and the commit is associated with multiple pull requests
71
+
the git provider API may return more than one pull request. In such cases, the `{{ pull_request_number }}` variable will contain the number of the first pull request returned by the API.
72
+
73
+
The `{{ pull_request_number }}` variable is currently supported only for the GitHub provider when used in a push event.
74
+
70
75
### Defining Parameters with Object Values in YAML
71
76
72
77
When working with YAML, particularly when defining parameters, you might encounter situations where you need to pass an object or a dynamic variable (e.g., `{{ body }}`) as the value of a parameter. However, YAML's validation rules prevent such values from being defined inline.
0 commit comments