title: buildx call failed with: error: tag is needed when pushing to registry - why are tags in metadata-action not being read by build-push-action?
body: <p>I am trying to create a Github-Actions workflow - <a href="http://github.com/kusur/learning-audio-processing/blob/main/.github/workflows/pytorch_error.yml" rel="nofollow noreferrer">pytorch_error.yml</a> to automatically push Docker images to Docker Hub using Github Actions -</p>
  <pre><code># This is a basic workflow to help you get started with Actions
  
  name: Building and pushing Docker images to Docker hub
  
  # Controls when the workflow will run
  on:  
    workflow_dispatch:
      branches: [main]
  
  # A workflow run is made up of one or more jobs that can run sequentially or in parallel
  jobs:
    # This workflow contains a single job called &quot;build&quot;
    build_push_pytorch_docker_image:
      name: Build and push apex-pytorch-image image to Docker Hub
      # The type of runner that the job will run on
      runs-on: ubuntu-latest
  
      # Steps represent a sequence of tasks that will be executed as part of the job
      steps:
        # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
        - name: Checkout Github repo
          uses: actions/checkout@v2
  
        - name: Log into Docker Hub
          uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
          with:
            username: ${{ secrets.DOCKERHUB_USERNAME }}
            password: ${{ secrets.DOCKERHUB_PASSWORD }}
  
        - name: Get Metadata (tags,labels) for Docker images
          id: meta_pytorch
          uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
          with: 
            images: kusur/apex-pytorch-image
  
        - name: Build and push Docker image to Docker Hub
          uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
          with:
            context: .
            file: ./dockerfile-pytorch
            push: true
            tags: ${{ steps.meta_pytorch.ouputs.tags }}
            labels: ${{ steps.meta_pytorch.outputs.labels }}
  </code></pre>
  <p>Whenever I execute this code, I get the following error -</p>
  <pre><code>error: tag is needed when pushing to registry
  Error: buildx call failed with: error: tag is needed when pushing to registry
  </code></pre>
  <p>While looking at the logs, I see that the tag is being generated at the previous step i.e &quot;Get Metadata (tags,labels) for Docker images&quot; -</p>
  <pre><code>  with:
      images: ***/apex-pytorch-image
      github-token: ***
  Context info
    eventName: workflow_dispatch
    sha: 046137ce5ae09aac18ba44083cd061ac3a37e48a
    ref: refs/heads/main
    workflow: Building and pushing Docker images to Docker hub
    action: meta_pytorch
    actor: ***
    runNumber: 2
    runId: 1090239471
  Processing tags input
    type=schedule,pattern=nightly,enable=true,priority=1000
    type=ref,event=branch,enable=true,priority=600
    type=ref,event=tag,enable=true,priority=600
    type=ref,event=pr,prefix=pr-,enable=true,priority=600
  Processing flavor input
    latest=auto
    prefix=
    suffix=
  Docker image version
    main
  Docker tags
    ***/apex-pytorch-image:main
  Docker labels
    org.opencontainers.image.title=learning-audio-processing
    org.opencontainers.image.description=Learning Audio Processing
    org.opencontainers.image.url=https://github.com/***/learning-audio-processing
    org.opencontainers.image.source=https://github.com/***/learning-audio-processing
    org.opencontainers.image.version=main
    org.opencontainers.image.created=2021-08-02T12:39:20.636Z
    org.opencontainers.image.revision=046137ce5ae09aac18ba44083cd061ac3a37e48a
    org.opencontainers.image.licenses=Unlicense
  JSON output
    {
      &quot;tags&quot;: [
        &quot;***/apex-pytorch-image:main&quot;
      ],
      &quot;labels&quot;: {
        &quot;org.opencontainers.image.title&quot;: &quot;learning-audio-processing&quot;,
        &quot;org.opencontainers.image.description&quot;: &quot;Learning Audio Processing&quot;,
        &quot;org.opencontainers.image.url&quot;: &quot;https://github.com/***/learning-audio-processing&quot;,
        &quot;org.opencontainers.image.source&quot;: &quot;https://github.com/***/learning-audio-processing&quot;,
        &quot;org.opencontainers.image.version&quot;: &quot;main&quot;,
        &quot;org.opencontainers.image.created&quot;: &quot;2021-08-02T12:39:20.636Z&quot;,
        &quot;org.opencontainers.image.revision&quot;: &quot;046137ce5ae09aac18ba44083cd061ac3a37e48a&quot;,
        &quot;org.opencontainers.image.licenses&quot;: &quot;Unlicense&quot;
      }
    }
  Bake definition file
    {
      &quot;target&quot;: {
        &quot;docker-metadata-action&quot;: {
          &quot;tags&quot;: [
            &quot;***/apex-pytorch-image:main&quot;
          ],
          &quot;labels&quot;: {
            &quot;org.opencontainers.image.title&quot;: &quot;learning-audio-processing&quot;,
            &quot;org.opencontainers.image.description&quot;: &quot;Learning Audio Processing&quot;,
            &quot;org.opencontainers.image.url&quot;: &quot;https://github.com/***/learning-audio-processing&quot;,
            &quot;org.opencontainers.image.source&quot;: &quot;https://github.com/***/learning-audio-processing&quot;,
            &quot;org.opencontainers.image.version&quot;: &quot;main&quot;,
            &quot;org.opencontainers.image.created&quot;: &quot;2021-08-02T12:39:20.636Z&quot;,
            &quot;org.opencontainers.image.revision&quot;: &quot;046137ce5ae09aac18ba44083cd061ac3a37e48a&quot;,
            &quot;org.opencontainers.image.licenses&quot;: &quot;Unlicense&quot;
          },
          &quot;args&quot;: {
            &quot;DOCKER_META_IMAGES&quot;: &quot;***/apex-pytorch-image&quot;,
            &quot;DOCKER_META_VERSION&quot;: &quot;main&quot;
          }
        }
      }
    }
  </code></pre>
  <p>but it is not being read by the <code>build-push-action</code>. This code is copied from <a href="https://docs.github.com/en/actions/guides/publishing-docker-images" rel="nofollow noreferrer">Publishing Docker Images</a>. Another file created from this reference is <a href="https://github.com/kusur/learning-audio-processing/blob/main/.github/workflows/pytorch_image.yml" rel="nofollow noreferrer">pytorch_image.yml</a> and this code executes without any issue but the code in question is breaking again and again. I am not able to make out any difference between <code>pytorch_image.yml</code> and <code>pytorch_error.yml</code> Any help?</p>