Skip to main content
Task results allow you to output data from a task that can be consumed by other tasks in a pipeline or accessed after the task completes.

Example

How It Works

1

Declare Results

The task declares two results in the results section, each with a name and description. This tells Tekton to create files where result values can be written.
2

Write to Result Files

Each step writes its output to a result file using $(results.NAME.path). The tee command both prints the output and writes it to the result file.
3

Results are Captured

After the task completes, Tekton reads the content from the result files and makes them available in the TaskRun status.

Writing Results

To write a result value:
Or use tee to both display and write:
Result values must be plain text strings. Tekton will trim any trailing newlines from result values.

Expected Output

The task will output something like:
After execution, you can view the results:
Results section will show:

Key Concepts

  • Results: Named output values from a task
  • Result Path: Use $(results.NAME.path) to get the file path where the result should be written
  • Result Size: Results have a maximum size (typically 4KB for string results)
  • Result Usage: Results can be passed to other tasks in a pipeline using $(tasks.TASK_NAME.results.RESULT_NAME)

Next Steps