Closed hegerdes closed 1 year ago
For setting multiple labels to the actions input you need a setup like this:
- name: Build and push uses: docker/build-push-action@v4 with: push: true tags: user/app:latest labels: | Foo=Bar Bar=Baz
but this can not be archived when using ${{ inputs.labels }} in GH Action when it is a reusable workflow or a manuell one. The CSV variant also does not work because ignore commas in https://github.com/docker/build-push-action/blob/a799b4decf46d51b39dd396f4df5a4343afd30c4/src/context.ts#L55 is set to true
${{ inputs.labels }}
CSV
- name: Build and push uses: docker/build-push-action@v4 with: push: true tags: user/app:latest labels: ${{ inputs.build-labels }}
This is needed because GH Action inputs only allow the types string, choice and bolean but not objects or arrays
string
choice
bolean
Consider allowing CSV input to allow for reusable/composite and manuell workflow usage
We can't use CSV type for labels as you've seen in #874. For your case consider adding an extra step like https://github.com/docker/metadata-action/issues/298#issuecomment-15874439780.
For setting multiple labels to the actions input you need a setup like this:
but this can not be archived when using
${{ inputs.labels }}
in GH Action when it is a reusable workflow or a manuell one. TheCSV
variant also does not work because ignore commas in https://github.com/docker/build-push-action/blob/a799b4decf46d51b39dd396f4df5a4343afd30c4/src/context.ts#L55 is set to trueThis is needed because GH Action inputs only allow the types
string
,choice
andbolean
but not objects or arraysConsider allowing
CSV
input to allow for reusable/composite and manuell workflow usage