Example
How It Works
Define the Task with Parameters
The Task defines a parameter named
input with a default value. This parameter can be referenced in steps using the $(params.input) syntax.Reference the Task
The TaskRun references the Task by name using
taskRef. Because the parameter has a default value, it’s optional to provide a value in the TaskRun.Parameter Substitution
Parameters are referenced in Task steps using the syntax:Expected Output
With default parameter:Key Concepts
- Parameters: Named values that can be passed to tasks
- Default Values: Optional fallback values when no parameter is provided
- Parameter Substitution: Using
$(params.name)syntax to reference parameter values - Task Reusability: The same task can be run with different parameter values
Next Steps
- Learn about task results
- See how pipelines use parameters