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
fix: correct CEL expression syntax in filtering example
Fix syntax error in the CEL regex expression by separating
the patterns into individual matches() calls connected with
logical OR operators. This resolves the token recognition
errors caused by unescaped pipe characters in the regex.
Also added a warning about proper escaping of special
characters in CEL expressions to help users avoid similar
syntax errors.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Only match `pull_request` events targeting the `main` branch
392
392
* **Exclude** the PipelineRun if all changed files match any of the following patterns:
393
393
* Files in the `docs/` directory (`^docs/`)
394
-
* Markdown files (`.md$`)
395
-
* Common repository metadata files (`.gitignore`, `OWNERS`, `PROJECT`, `LICENSE`)
394
+
* Markdown files (`\\.md$`)
395
+
* Common repository metadata files (`\\.gitignore`, `OWNERS`, `PROJECT`, `LICENSE`)
396
396
397
-
The `!files.all.all(x, x.matches('pattern'))` syntax means "not all files match the pattern", which effectively means "trigger only if at least one file doesn't match the exclusion pattern" (i.e., there are meaningful code changes).
397
+
The `!files.all.all(x, x.matches('pattern1') || x.matches('pattern2') || ...)` syntax means "not all files match any of these patterns", which effectively means "trigger only if at least one file doesn't match the exclusion patterns" (i.e., there are meaningful code changes).
398
+
399
+
{{< hint warning >}}
400
+
**Important**: When using regex patterns in CEL expressions, remember to properly escape special characters. The backslash (`\`) needs to be doubled (`\\`) to escape properly within the CEL string context. Using logical OR (`||`) operators within the `matches()` function is more reliable than combining patterns with pipe (`|`) characters in a single regex.
401
+
{{< /hint >}}
398
402
399
403
### Matching PipelineRun to an event (commit, pull_request) title
0 commit comments