--- title: "ADR 0075: Placeholder substitution treats cel: and body/headers/files errors differently" --- * Status: accepted * Code: [`pkg/templates/templating.go`](https://github.com/tektoncd/pipelines-as-code/blob/main/pkg/templates/templating.go) ## Context `ReplacePlaceHoldersVariables` replaces `{{ key }}` matches (`keys.ParamsRe`) in a template. Keys can be plain parameters from `dico`, or start with `body`, `headers`, `files` or `cel:`, which are evaluated with `cel.Value`. ## Decision * A key with the `cel:` prefix is always evaluated; the expression is the text after the prefix, trimmed. * `body*` is evaluated only if `rawEvent != nil`, `headers*` only if `headers != nil`; `files*` is evaluated unconditionally. * Only for `cel:` keys is `dico` passed to the evaluator as the PaC parameters, so `pac.*` variables resolve there; the other prefixes get an empty map. * The first value of each header is passed (`v[0]`). * If evaluation fails, a `cel:` placeholder is replaced by an empty string, while the other prefixes keep the original placeholder text `s`. ## Consequences * A broken `cel:` expression silently produces an empty value in the output, whereas a broken `body.x` stays visible as `{{ body.x }}`. * Only the first value of a multi-valued header is visible to expressions. * The code does not show why the two error behaviours differ.