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
This commit introduces a new command `tkn pac cel` that allows
users to interactively evaluate CEL (Common Expression Language)
expressions. The command is designed to help users test and debug
CEL expressions, which are commonly used in Pipelines-as-Code.
Key features include:
- Interactive and non-interactive modes.
- Support for webhook payloads and headers.
- Provider auto-detection (GitHub, GitLab, Bitbucket Cloud,
Bitbucket Data Center, Gitea).
- Direct access to variables as per PAC documentation.
- Cross-platform history with readline experience.
- Comprehensive help and example expressions.
Signed-off-by: Chmouel Boudjnah <[email protected]>
Copy file name to clipboardExpand all lines: docs/content/docs/guide/cli.md
+93Lines changed: 93 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -409,6 +409,99 @@ You can specify a different directory than the current one by using the -d/--dir
409
409
410
410
{{< /details >}}
411
411
412
+
{{< details "tkn pac cel" >}}
413
+
414
+
### CEL Expression Evaluator
415
+
416
+
`tkn pac cel` — Evaluate CEL (Common Expression Language) expressions interactively with webhook payloads.
417
+
418
+
This command allows you to test and debug CEL expressions as they would be evaluated by Pipelines-as-Code, using real webhook payloads and headers. It supports interactive and non-interactive modes, provider auto-detection, and persistent history.
419
+
420
+
To be able to have the CEL evaluator working, you need to have the payload and the headers available in a file. The best way to do this is to go to the webhook configuration on your git provider and copy the payload and headers to different files.
421
+
422
+
The payload is the JSON content of the webhook requests, and the headers are a simple HTTP headers file looking like this:
0 commit comments