Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support CEL's variable substitution in WhenExpression.CEL #7287

Open
Tracked by #7244
Yongxuanzhang opened this issue Oct 26, 2023 · 0 comments
Open
Tracked by #7244

Support CEL's variable substitution in WhenExpression.CEL #7287

Yongxuanzhang opened this issue Oct 26, 2023 · 0 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@Yongxuanzhang
Copy link
Member

Yongxuanzhang commented Oct 26, 2023

CEL in WhenExpression has been implemented. And current variable substitution only supports Tekton's variable substitution. e.g.

  when:
    # string result
    - cel: "$(tasks.unit-test.results.test-coverage) > 0.9"
    # array indexing result
    - cel: "$(tasks.unit-test.results.test-coverage[0]) > 0.9"
    # object result key
    - cel: "'$(tasks.objectTask.results.repo.url)'.matches('github.com/tektoncd/.*')"
    # string param
    - cel: "'$(params.foo)' == 'foo'"
    # array indexing
    - cel: "'$(params.branch[0])' == 'foo'"
    # object param key
    - cel: "'$(params.repo.url)'.matches('github.com/tektoncd/.*')"

CEL's variable substitution is:

  when:
    # string result
    - cel: "tasks.unit-test.results.test-coverage > 0.9"
    # array indexing result
    - cel: "tasks.unit-test.results.test-coverage[0] > 0.9"
    # object result key
    - cel: "'tasks.objectTask.results.repo.url.matches('github.com/tektoncd/.*')"
    # string param
    - cel: "params.foo == 'foo'"
    # array indexing
    - cel: "params.branch[0] == 'foo'"
    # object param key
    - cel: "params.repo.url.matches('github.com/tektoncd/.*')"
@Yongxuanzhang Yongxuanzhang changed the title (Optional) Add CEL's variable substitution Support CEL's variable substitution in WhenExpression.CEL Oct 26, 2023
@Yongxuanzhang Yongxuanzhang added the kind/feature Categorizes issue or PR as related to a new feature. label Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

1 participant