-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(tekton): support matching pruns via labels
Implement annotation-based PipelineRun to label matching functionality: - Add `pipelinesascode.tekton.dev/on-label` annotation for label-based PipelineRun triggers - Support label matching on GitHub, Gitea, and GitLab providers - Implement immediate PipelineRun triggering when labels are added - Enable re-triggering of PipelineRuns on commit updates with existing labels - Provide access to Pull Request labels via `{{ pull_request_labels }}` dynamic variable Supported providers: - GitHub - Gitea - GitLab Limitations: - Not supported on Bitbucket Cloud and Bitbucket Server Signed-off-by: Chmouel Boudjnah <[email protected]>
- Loading branch information
Showing
35 changed files
with
544 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,23 +47,24 @@ getting tested. You usually use this with the | |
[git-clone](https://hub.tekton.dev/tekton/task/git-clone) task to be able to | ||
checkout the code that is being tested. | ||
|
||
| Variable | Description | Example | Example Output | | ||
|---------------------|---------------------------------------------------------------------------------------------------|-------------------------------------|------------------------------| | ||
| body | The full payload body (see [below](#using-the-body-and-headers-in-a-pipelines-as-code-parameter)) | `{{body.pull_request.user.email }}` | <[email protected]> | | ||
| 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" >}}) ) | | ||
| git_auth_secret | The secret name auto generated with provider token to check out private repos. | `{{git_auth_secret}}` | pac-gitauth-xkxkx | | ||
| headers | The request headers (see [below](#using-the-body-and-headers-in-a-pipelines-as-code-parameter)) | `{{headers['x-github-event']}}` | push | | ||
| pull_request_number | The pull or merge request number, only defined when we are in a `pull_request` event type. | `{{pull_request_number}}` | 1 | | ||
| repo_name | The repository name. | `{{repo_name}}` | pipelines-as-code | | ||
| repo_owner | The repository owner. | `{{repo_owner}}` | openshift-pipelines | | ||
| repo_url | The repository full URL. | `{{repo_url}}` | https:/github.com/repo/owner | | ||
| revision | The commit full sha revision. | `{{revision}}` | 1234567890abcdef | | ||
| sender | The sender username (or accountid on some providers) of the commit. | `{{sender}}` | johndoe | | ||
| source_branch | The branch name where the event come from. | `{{source_branch}}` | main | | ||
| source_url | The source repository URL from which the event come from (same as `repo_url` for push events). | `{{source_url}}` | https:/github.com/repo/owner | | ||
| target_branch | The branch name on which the event targets (same as `source_branch` for push events). | `{{target_branch}}` | main | | ||
| target_namespace | The target namespace where the Repository has matched and the PipelineRun will be created. | `{{target_namespace}}` | my-namespace | | ||
| 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 | | ||
| Variable | Description | Example | Example Output | | ||
|---------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------| | ||
| body | The full payload body (see [below](#using-the-body-and-headers-in-a-pipelines-as-code-parameter)) | `{{body.pull_request.user.email }}` | <[email protected]> | | ||
| 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" >}}) ) | | ||
| git_auth_secret | The secret name auto generated with provider token to check out private repos. | `{{git_auth_secret}}` | pac-gitauth-xkxkx | | ||
| headers | The request headers (see [below](#using-the-body-and-headers-in-a-pipelines-as-code-parameter)) | `{{headers['x-github-event']}}` | push | | ||
| pull_request_number | The pull or merge request number, only defined when we are in a `pull_request` event type. | `{{pull_request_number}}` | 1 | | ||
| repo_name | The repository name. | `{{repo_name}}` | pipelines-as-code | | ||
| repo_owner | The repository owner. | `{{repo_owner}}` | openshift-pipelines | | ||
| repo_url | The repository full URL. | `{{repo_url}}` | https:/github.com/repo/owner | | ||
| revision | The commit full sha revision. | `{{revision}}` | 1234567890abcdef | | ||
| sender | The sender username (or accountid on some providers) of the commit. | `{{sender}}` | johndoe | | ||
| source_branch | The branch name where the event come from. | `{{source_branch}}` | main | | ||
| source_url | The source repository URL from which the event come from (same as `repo_url` for push events). | `{{source_url}}` | https:/github.com/repo/owner | | ||
| target_branch | The branch name on which the event targets (same as `source_branch` for push events). | `{{target_branch}}` | main | | ||
| target_namespace | The target namespace where the Repository has matched and the PipelineRun will be created. | `{{target_namespace}}` | my-namespace | | ||
| 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 | | ||
| pull_request_labels | The labels of the pull request separated by a newline | `{{pull_request_labels}}` | bugs\nenhancement | | ||
|
||
## Matching an event to a PipelineRun | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.