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
- Users can set a GitOps command prefix in the Repository CR
to run /<prefix> test, /<prefix> retest, /<prefix> cancel.
- Configure prefix in Repository CR's settings field.
- Apply prefix-aware matching for GitHub issue/commit comments,
including ok-to-test SHA validation and target selection.
- Update repo schema/docs and opscomments helpers for prefixed
regex matching and command extraction.
- Add provider parse tests and e2e coverage for GitHub prefix
flows to validate behavior end-to-end.
- Add documentation explaining the feature thoroughly.
https://issues.redhat.com/browse/SRVKP-7197
Signed-off-by: Zaki Shaikh <zashaikh@redhat.com>
Copy file name to clipboardExpand all lines: docs/content/docs/guides/gitops-commands/advanced.md
+41Lines changed: 41 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,6 +46,47 @@ This ensures the comment is correctly formatted when processed.
46
46
47
47
For a practical example, see the [pac-boussole](https://github.com/openshift-pipelines/pac-boussole) project, which uses the `on-comment` annotation to create a PipelineRun experience similar to [Prow](https://docs.prow.k8s.io/).
You can configure a custom prefix for GitOps commands in the Repository CR. This allows you to use commands like `/pac test` instead of the standard `/test`. This is useful when both [prow](https://docs.prow.k8s.io/) CI and Pipelines-as-Code are configured on a Repository and making comments causes issues and confusion.
54
+
55
+
Please note that custom GitOps commands are excluded from this prefix settings.
56
+
57
+
To configure a custom GitOps command prefix, set the `gitops_command_prefix` field in your Repository CR's `settings` section:
58
+
59
+
```yaml
60
+
apiVersion: "pipelinesascode.tekton.dev/v1alpha1"
61
+
kind: Repository
62
+
metadata:
63
+
name: my-repository
64
+
namespace: pipelines-as-code
65
+
spec:
66
+
url: "https://github.com/organization/repository"
67
+
settings:
68
+
gitops_command_prefix: "pac"
69
+
```
70
+
71
+
Note: Set the prefix as a plain word (e.g. `pac`). The Forward slash (`/`) is added automatically by Pipelines-as-Code.
72
+
73
+
With this configuration, you can use the following prefixed commands:
74
+
75
+
- `/pac test`- Trigger all matching PipelineRuns
76
+
- `/pac test <pipelinerun-name>`- Trigger a specific PipelineRun
77
+
- `/pac retest`- Retest failed PipelineRuns
78
+
- `/pac retest <pipelinerun-name>`- Retest specific PipelineRun
79
+
- `/pac cancel`- Cancel all running PipelineRuns
80
+
- `/pac cancel <pipelinerun-name>`- Cancel Specific PipelineRun
81
+
- `/pac ok-to-test`- Approve CI for external contributors
82
+
- `/pac ok-to-test SHA`- Approve CI for external contributors for a specific SHA
83
+
84
+
Example:
85
+
86
+
```text
87
+
/pac test
88
+
```
89
+
49
90
## Cancelling a PipelineRun
50
91
51
92
**What it does:** The `/cancel` command stops running PipelineRuns by commenting on the pull request.
0 commit comments