1

I know that there is something like context.pipelineRun.name but that's only available in the pipeline. How can I get the pipeline name inside a task to build a link to the Tekton-dashboard, WITHOUT a parameter?

2 Answers2

1

From Tekton's documentation (https://tekton.dev/docs/pipelines/variables/) the name of the pipelinerun is not available in the task. So, I see only the possibility to pass it as a parameter from the pipelinerun (where it is available under context.pipelineRun.name). Or you use the task's name (context.taskRun.name), if that is sufficient for you.

jsk
  • 21
  • 3
0

As what I know

context.pipelineRun.name

should work in your Task, if your Task is executed in a PipelineRun - since Tasks is the way to execute things in a Pipeline. Although, this variable will not be available if you run your Task standalone.

Jonas
  • 121,568
  • 97
  • 310
  • 388
  • Can I "access" this inside the task or do I have to pass it into the task as a param? –  Jul 03 '22 at 13:02