Skip to content

Commit 06fcbb7

Browse files
committed
Add support for annotations
1 parent 2583627 commit 06fcbb7

File tree

5 files changed

+93
-27
lines changed

5 files changed

+93
-27
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ The following inputs can be used as `step.with` keys and match the inputs from [
122122
| ------------------ | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
123123
| `add-hosts` | List/CSV | List of [customs host-to-IP mapping](https://docs.docker.com/engine/reference/commandline/build/#add-entries-to-container-hosts-file---add-host) (e.g., `docker:10.180.0.1`) |
124124
| `allow` | List/CSV | List of [extra privileged entitlement](https://github.com/docker/buildx/blob/master/docs/reference/buildx_build.md#allow) (e.g., `network.host,security.insecure`) |
125+
| `annotations` | List | List of annotation to set to the image |
125126
| `attests` | List | List of [attestation](https://docs.docker.com/build/attestations/) parameters (e.g., `type=sbom,generator=image`) |
126127
| `build-args` | List | List of [build-time variables](https://github.com/docker/buildx/blob/master/docs/reference/buildx_build.md#build-arg) |
127128
| `build-contexts` | List | List of additional [build contexts](https://github.com/docker/buildx/blob/master/docs/reference/buildx_build.md#build-context) (e.g., `name=path`) |

action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ inputs:
1515
allow:
1616
description: 'List of extra privileged entitlement (e.g., network.host,security.insecure)'
1717
required: false
18+
annotations:
19+
description: 'List of annotation to set to the image'
20+
required: false
1821
attests:
1922
description: 'List of attestation parameters (e.g., type=sbom,generator=image)'
2023
required: false

dist/index.js

Lines changed: 86 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/context.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import * as path from 'path'
99
export interface Inputs {
1010
addHosts: string[]
1111
allow: string[]
12+
annotations: string[]
1213
attests: string[]
1314
buildArgs: string[]
1415
buildContexts: string[]
@@ -52,6 +53,7 @@ export function getInputs(): Inputs {
5253
return {
5354
addHosts: getListInput('add-hosts'),
5455
allow: getListInput('allow'),
56+
annotations: getListInput('annotations', {ignoreComma: true}),
5557
attests: getListInput('attests', {ignoreComma: true}),
5658
buildArgs: getListInput('build-args', {ignoreComma: true}),
5759
buildContexts: getListInput('build-contexts', {ignoreComma: true}),

src/depot.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ export async function build(inputs: Inputs) {
5959
const buildxArgs = [
6060
...flag('--add-host', inputs.addHosts),
6161
...flag('--allow', inputs.allow.join(',')),
62+
...flag('--annotation', inputs.annotations),
6263
...flag('--attest', inputs.attests),
6364
...flag('--build-arg', inputs.buildArgs),
6465
...flag('--build-context', inputs.buildContexts),

0 commit comments

Comments
 (0)