diff --git a/core/src/main/java/io/kestra/plugin/core/debug/Return.java b/core/src/main/java/io/kestra/plugin/core/debug/Return.java index 0951cd10f1d..3fa44c35cff 100644 --- a/core/src/main/java/io/kestra/plugin/core/debug/Return.java +++ b/core/src/main/java/io/kestra/plugin/core/debug/Return.java @@ -25,7 +25,7 @@ @Schema( title = "Return a value for debugging purposes.", description = "This task is mostly useful for troubleshooting.\n\n" + - "It allows you to return some templated functions, inputs or outputs." + "It allows you to return some templated functions, inputs or outputs. In some cases you might want to trim all white spaces from the rendered values so downstream tasks can use them properly" ) @Plugin( examples = { @@ -39,6 +39,18 @@ type: io.kestra.plugin.core.debug.Return format: "{{ task.id }} > {{ taskrun.startDate }}" """ + ), + @Example( + code = """ + id: compute_header + type: io.kestra.plugin.core.debug.Return + format: >- + {%- if inputs.token is not empty -%} + Bearer {{ inputs.token }} + {%- elseif inputs.username is not empty and inputs.password is not empty -%} + Basic {{ (inputs.username + ':' + inputs.password) | base64encode }} + {%- endif -%} + """ ) }, metrics = {