Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/.test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -589,9 +589,9 @@ jobs:
packages: write
with:
annotations: |
io.github.docker.github-builder.test-index-annotation=build-${{ github.run_id }}
io.github.docker.github-builder.test-direct-index-annotation={{meta.version}}
labels: |
io.github.docker.github-builder.test-label=build-${{ github.run_id }}
io.github.docker.github-builder.test-direct-label=build-{{meta.version}}
build-args: |
VERSION={{meta.version}}
file: test/hello.Dockerfile
Expand All @@ -604,6 +604,10 @@ jobs:
meta-images: ghcr.io/docker/github-builder-test
meta-tags: |
type=raw,value=build-index-annotations-${{ github.run_id }}
meta-labels: |
io.github.docker.github-builder.test-meta-label=build-${{ github.run_id }}
meta-annotations: |
io.github.docker.github-builder.test-meta-index-annotation=build-${{ github.run_id }}
secrets:
registry-auths: |
- registry: ghcr.io
Expand Down
16 changes: 14 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ on:
default: 0
annotations:
type: string
description: "List of annotations to set to the image (for image output)"
description: "List of annotations to set to the image"
required: false
build-args:
type: string
Expand Down Expand Up @@ -78,7 +78,7 @@ on:
required: false
labels:
type: string
description: "List of labels for an image (for image output)"
description: "List of labels for an image"
required: false
output:
type: string
Expand Down Expand Up @@ -134,6 +134,14 @@ on:
type: string
description: "List of tags as key-value pair attributes"
required: false
meta-labels:
type: string
description: "List of custom labels"
required: false
meta-annotations:
type: string
description: "List of custom annotations"
required: false
meta-flavor:
type: string
description: "Flavor defines a global behavior for meta-tags"
Expand Down Expand Up @@ -558,6 +566,8 @@ jobs:
images: ${{ needs.prepare.outputs.metaImages }}
tags: ${{ inputs.meta-tags }}
flavor: ${{ inputs.meta-flavor }}
labels: ${{ inputs.meta-labels }}
annotations: ${{ inputs.meta-annotations }}
-
name: Set up QEMU
uses: docker/setup-qemu-action@96fe6ef7f33517b61c61be40b68a1882f3264fb8 # v4.2.0
Expand Down Expand Up @@ -1028,6 +1038,8 @@ jobs:
images: ${{ needs.prepare.outputs.metaImages }}
tags: ${{ inputs.meta-tags }}
flavor: ${{ inputs.meta-flavor }}
labels: ${{ inputs.meta-labels }}
annotations: ${{ inputs.meta-annotations }}
-
name: Login to registry
if: ${{ inputs.push && inputs.output == 'image' }}
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,8 @@ jobs:
| `set-meta-labels` | Bool | `false` | Append OCI Image Format Specification labels generated by `docker/metadata-action` |
| `meta-images` | List | | [List of images](https://github.com/docker/metadata-action?tab=readme-ov-file#images-input) to use as base name for tags (required for image output) |
| `meta-tags` | List | | [List of tags](https://github.com/docker/metadata-action?tab=readme-ov-file#tags-input) as key-value pair attributes |
| `meta-labels` | List | | [List of custom labels](https://github.com/docker/metadata-action?tab=readme-ov-file#overwrite-labels-and-annotations) |
| `meta-annotations` | List | | [List of custom annotations](https://github.com/docker/metadata-action?tab=readme-ov-file#overwrite-labels-and-annotations) |
| `meta-flavor` | List | | [Flavor](https://github.com/docker/metadata-action?tab=readme-ov-file#flavor-input) defines a global behavior for `meta-tags` |

### Secrets
Expand Down Expand Up @@ -458,3 +460,10 @@ jobs:
*.args.VERSION={{meta.version}}
meta-images: name/app
```

> [!NOTE]
> The `meta-labels` and `meta-annotations` inputs are passed to
> `docker/metadata-action`, so their templates follow `docker/metadata-action`
> behavior. Enable `set-meta-labels` or `set-meta-annotations` to apply those
> generated values to the image. In the build workflow, generated values are
> appended to any `labels` or `annotations` already set.
Loading