title: Passing variables between Tekton Steps
body: <p>I am trying to implement a basic Tekton CI pipeline. All the pipeline does is 1) get the source code 2) build an image with a new version and push it to an image registry.</p>
  <p>The image version is generated by a Tekton Step. Images are built by another Tekton step that uses Kaniko as described <a href="https://github.com/tektoncd/pipeline/blob/main/docs/tutorial.md#specifying-task-inputs-and-outputs" rel="nofollow noreferrer">here</a>.</p>
  <p>I am aware of using workspaces to pass variables between Tekton steps. Meaning I can write the version to a file in the workspace. But cant figure out a way to read this version from the file in the Kaniko build step below:</p>
  <pre><code>  steps:
      - name: build-and-push
        image: gcr.io/kaniko-project/executor:latest
        # specifying DOCKER_CONFIG is required to allow kaniko to detect docker credential
        env:
          - name: &quot;DOCKER_CONFIG&quot;
            value: &quot;/tekton/home/.docker/&quot;
        command:
          - /kaniko/executor
        args:
          - --dockerfile=$(params.pathToDockerFile)
          - --destination=$(resources.outputs.builtImage.url):&lt;IMAGE-VERSION-NEEDED-HERE&gt;
          - --context=$(params.pathToContext)
          - --build-arg=BASE=alpine:3
  </code></pre>
  <p>There should be a common pattern to resolve this but I am not sure if I am looking at the right places in Tekton documentation for this.</p>
  <p>Can anyone offer some pointers?</p>