Skip to content

meta-images input doesn't work with attributes #327

Closed

Description

@Luit

Contributing guidelines

I've found a bug, and:

  • The documentation does not mention anything about my problem
  • There are no open or closed issues that are related to my problem

Description

When trying this workflow with a meta-images input with name=something,enable=${{ sometimes }} the workflow fails in the build step of the build job with a buildx failed with: failed to build: failed to solve: failed to parse ref "name=something": invalid reference format.

It is not documented to work any different than the metadata-action's images input.

Expected behaviour

I expected meta-images to accept the same inputs as the metadata-action's images input.

Actual behaviour

buildx failed with: failed to build: failed to solve: failed to parse ref "name=something": invalid reference format

Repository URL

No response

Workflow run URL

No response

YAML workflow

---
name: "Build and Push Images"

on:
  push:
  pull_request:

jobs:
  build:
    uses: docker/github-builder/.github/workflows/build.yml@v1
    permissions:
      contents: read # to fetch the repository content
      id-token: write # for signing attestations and cache entries with GitHub OIDC
    with:
      output: image
      platforms: linux/amd64,linux/arm64
      push: ${{ github.event_name != 'pull_request' }}
      sbom: ${{ github.event_name != 'pull_request' }}
      sign: ${{ github.event_name != 'pull_request' }}
      meta-flavor: |
        latest=false
      meta-images: |
        name=${{ vars.REGISTRY_HOST }}/prod/${{ vars.REGISTRY_REPO }},enable=${{ startsWith(github.ref, 'refs/tags/v') }}
        name=${{ vars.REGISTRY_HOST }}/build/${{ vars.REGISTRY_REPO }}
      meta-tags: |
        type=ref,event=branch
        type=ref,event=pr
        type=semver,pattern={{version}}
    secrets:
      registry-auths: |
        - registry: ${{ vars.REGISTRY_HOST }}
          username: ${{ secrets.REGISTRY_USER }}
          password: ${{ secrets.REGISTRY_PASS }}

Workflow logs

I can see the build-push-action has this in the input:

outputs: type=image,"name=name=<redacted>/prod/<redacted>,enable=false,name=<redacted>/build/<redacted>",oci-artifact=true,push-by-digest=true,name-canonical=true,push=true

Note the name=name=.

BuildKit logs


Additional info

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions