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
Now that CEL interceptor is in there, I'd like to see if we can't agree on how to do CEL munging, i.e. the original values implementation in early days of that branch.
triggers:
- name: cel-trig
interceptor:
cel:
filter: "headers.match('X-GitHub-Event', 'pull_request')"
values:
"pr.url": body.pull_request.url
"pr.short_sha": truncate(body.head.sha, 7)
I'd propose something similar, I don't have a better name than values, but I think it should be a list of key/values, with "key" and "expression" as the keys for each thing to update.
so...
triggers:
name: cel-trig
interceptor:
cel:
filter: "headers.match('X-GitHub-Event', 'pull_request')"
values:
- key: pr.url
expression: body.pull_request.url
- key: pr.short_sha
expression: truncate(body.head.sha, 7)
This would be used in the same way as the original values implementation, i.e. if the filter was successful, using sjson to set the keys in the body to the values returned by the expressions.
This allows an interceptor to add custom keys to the body, or, modify existing ones if it wants to.
The text was updated successfully, but these errors were encountered:
From @bigkevmcd in #49 (comment)
Now that CEL interceptor is in there, I'd like to see if we can't agree on how to do CEL munging, i.e. the original values implementation in early days of that branch.
triggers:
- name: cel-trig
interceptor:
cel:
filter: "headers.match('X-GitHub-Event', 'pull_request')"
values:
"pr.url": body.pull_request.url
"pr.short_sha": truncate(body.head.sha, 7)
I'd propose something similar, I don't have a better name than values, but I think it should be a list of key/values, with "key" and "expression" as the keys for each thing to update.
so...
triggers:
interceptor:
cel:
filter: "headers.match('X-GitHub-Event', 'pull_request')"
values:
- key: pr.url
expression: body.pull_request.url
- key: pr.short_sha
expression: truncate(body.head.sha, 7)
This would be used in the same way as the original values implementation, i.e. if the filter was successful, using sjson to set the keys in the body to the values returned by the expressions.
This allows an interceptor to add custom keys to the body, or, modify existing ones if it wants to.
The text was updated successfully, but these errors were encountered: