|
| 1 | +--- |
| 2 | +title: Status Check |
| 3 | +weight: 5 |
| 4 | +--- |
| 5 | + |
| 6 | +{{< tech_preview "Status Check settings in Repository CR" >}} |
| 7 | + |
| 8 | +This page explains how to report status checks for PipelineRuns that did not match the incoming event. Use this when you want visibility into which PipelineRuns in your `.tekton/` directory were skipped because their annotations (target branch, event type, CEL expression, or path filter) did not match. |
| 9 | + |
| 10 | +By default, Pipelines-as-Code only reports status for PipelineRuns that matched |
| 11 | +and ran. PipelineRuns that did not match are silently ignored. Enabling |
| 12 | +`status_check` makes Pipelines-as-Code report a status for each unmatched |
| 13 | +PipelineRun so you can see the full picture in your Git provider's UI. |
| 14 | + |
| 15 | +## Configuration |
| 16 | + |
| 17 | +Add the `status_check` block under `spec.settings` in your Repository CR: |
| 18 | + |
| 19 | +```yaml |
| 20 | +apiVersion: "pipelinesascode.tekton.dev/v1alpha1" |
| 21 | +kind: Repository |
| 22 | +metadata: |
| 23 | + name: my-repo |
| 24 | +spec: |
| 25 | + url: "https://github.com/owner/repo" |
| 26 | + settings: |
| 27 | + status_check: |
| 28 | + enabled: true |
| 29 | + mode: "per_unmatched_pipelinerun" |
| 30 | +``` |
| 31 | +
|
| 32 | +### Fields |
| 33 | +
|
| 34 | +| Field | Type | Default | Description | |
| 35 | +| --- | --- | --- | --- | |
| 36 | +| `enabled` | bool | `false` | Enable status check reporting for unmatched PipelineRuns. | |
| 37 | +| `mode` | string | | How to report status checks. See [Modes](#modes). | |
| 38 | +| `no_match_conclusion` | string | `skipped` | The conclusion to report for unmatched PipelineRuns. Only used when `mode` is `per_unmatched_pipelinerun`. Accepted values: `skipped`, `success`, `neutral`. | |
| 39 | +| `aggregate_name` | string | | The name of the aggregate status check. Only used when `mode` is `aggregate`. | |
| 40 | + |
| 41 | +### Modes |
| 42 | + |
| 43 | +Two modes are available: `per_unmatched_pipelinerun` and `aggregate`. |
| 44 | + |
| 45 | +#### `per_unmatched_pipelinerun` |
| 46 | + |
| 47 | +Reports a separate status for each PipelineRun that did not match the event. |
| 48 | +This is useful when you have multiple PipelineRuns targeting different events |
| 49 | +(for example, one for `pull_request` and one for `push`) and you want to see |
| 50 | +which ones were skipped on each event. |
| 51 | + |
| 52 | +```yaml |
| 53 | +spec: |
| 54 | + settings: |
| 55 | + status_check: |
| 56 | + enabled: true |
| 57 | + mode: "per_unmatched_pipelinerun" |
| 58 | +``` |
| 59 | + |
| 60 | +#### `aggregate` (planned) |
| 61 | + |
| 62 | +Will report a single aggregated status check for all PipelineRuns. It is not |
| 63 | +yet implemented. |
| 64 | + |
| 65 | +```yaml |
| 66 | +spec: |
| 67 | + settings: |
| 68 | + status_check: |
| 69 | + enabled: true |
| 70 | + mode: "aggregate" |
| 71 | + aggregate_name: "Pipelines as Code" |
| 72 | +``` |
| 73 | + |
| 74 | +### Customizing the conclusion |
| 75 | + |
| 76 | +By default, unmatched PipelineRuns are reported with a `skipped` conclusion. |
| 77 | +You can change this to `success` or `neutral` using the `no_match_conclusion` |
| 78 | +field: |
| 79 | + |
| 80 | +```yaml |
| 81 | +spec: |
| 82 | + settings: |
| 83 | + status_check: |
| 84 | + enabled: true |
| 85 | + mode: "per_unmatched_pipelinerun" |
| 86 | + no_match_conclusion: "success" |
| 87 | +``` |
| 88 | + |
| 89 | +## Provider behavior |
| 90 | + |
| 91 | +The `skipped` conclusion maps to different states depending on your Git provider: |
| 92 | + |
| 93 | +| Provider | Reported state | Notes | |
| 94 | +| --- | --- | --- | |
| 95 | +| GitHub App | `skipped` | Shown as a skipped check run. | |
| 96 | +| GitHub Webhook | `success` | GitHub commit status API does not support `skipped`. Reported as `success` with a "Skipped" description. | |
| 97 | +| GitLab | `skipped` | Shown as a skipped pipeline in the Pipelines tab. | |
| 98 | +| Bitbucket Cloud | `STOPPED` | Shown as a stopped build status. | |
| 99 | +| Bitbucket Data Center | `UNKNOWN` | Reported with an unknown state. | |
| 100 | +| Gitea / Forgejo | `success` | Gitea does not support `skipped`. Reported as `success` with a "Skipped" description. | |
| 101 | + |
| 102 | +## Example |
| 103 | + |
| 104 | +Consider a repository with two PipelineRuns: |
| 105 | + |
| 106 | +- `.tekton/build.yaml` -- targets `pull_request` events on the `main` branch |
| 107 | +- `.tekton/deploy.yaml` -- targets `push` events on the `main` branch |
| 108 | + |
| 109 | +When a pull request is opened, `build.yaml` matches and runs. Without |
| 110 | +`status_check`, `deploy.yaml` is silently ignored. With it enabled: |
| 111 | + |
| 112 | +```yaml |
| 113 | +spec: |
| 114 | + settings: |
| 115 | + status_check: |
| 116 | + enabled: true |
| 117 | + mode: "per_unmatched_pipelinerun" |
| 118 | +``` |
| 119 | + |
| 120 | +Pipelines-as-Code reports a `skipped` status for `deploy.yaml`, making it |
| 121 | +visible in the pull request's status checks that the PipelineRun exists but did |
| 122 | +not apply to this event. |
0 commit comments