Skip to content

Commit 47f3277

Browse files
authored
Merge pull request #52 from crazy-max/meta-json
meta-json output to retrieve generated tags from metadata-action
2 parents 50d593d + 837a88a commit 47f3277

File tree

3 files changed

+211
-8
lines changed

3 files changed

+211
-8
lines changed

.github/workflows/.test.yml

Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,21 @@ jobs:
4949
username: ${{ secrets.AWS_ACCESS_KEY_ID }}
5050
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
5151
52+
build-aws-single-outputs:
53+
runs-on: ubuntu-24.04
54+
needs:
55+
- build-aws-single
56+
steps:
57+
-
58+
name: Builder outputs
59+
uses: actions/github-script@v8
60+
env:
61+
INPUT_BUILDER-OUTPUTS: ${{ toJSON(needs.build-aws-single.outputs) }}
62+
with:
63+
script: |
64+
const builderOutputs = JSON.parse(core.getInput('builder-outputs'));
65+
core.info(JSON.stringify(builderOutputs, null, 2));
66+
5267
build-aws:
5368
uses: ./.github/workflows/build.yml
5469
permissions:
@@ -85,6 +100,21 @@ jobs:
85100
username: ${{ secrets.AWS_ACCESS_KEY_ID }}
86101
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
87102
103+
build-aws-outputs:
104+
runs-on: ubuntu-24.04
105+
needs:
106+
- build-aws
107+
steps:
108+
-
109+
name: Builder outputs
110+
uses: actions/github-script@v8
111+
env:
112+
INPUT_BUILDER-OUTPUTS: ${{ toJSON(needs.build-aws.outputs) }}
113+
with:
114+
script: |
115+
const builderOutputs = JSON.parse(core.getInput('builder-outputs'));
116+
core.info(JSON.stringify(builderOutputs, null, 2));
117+
88118
build-ghcr:
89119
uses: ./.github/workflows/build.yml
90120
permissions:
@@ -119,6 +149,21 @@ jobs:
119149
username: ${{ github.actor }}
120150
password: ${{ secrets.GITHUB_TOKEN }}
121151
152+
build-ghcr-outputs:
153+
runs-on: ubuntu-24.04
154+
needs:
155+
- build-ghcr
156+
steps:
157+
-
158+
name: Builder outputs
159+
uses: actions/github-script@v8
160+
env:
161+
INPUT_BUILDER-OUTPUTS: ${{ toJSON(needs.build-ghcr.outputs) }}
162+
with:
163+
script: |
164+
const builderOutputs = JSON.parse(core.getInput('builder-outputs'));
165+
core.info(JSON.stringify(builderOutputs, null, 2));
166+
122167
build-dockerhub-stage:
123168
uses: ./.github/workflows/build.yml
124169
permissions:
@@ -152,6 +197,21 @@ jobs:
152197
username: ${{ vars.DOCKERHUB_STAGE_USERNAME }}
153198
password: ${{ secrets.DOCKERHUB_STAGE_TOKEN }}
154199
200+
build-dockerhub-stage-outputs:
201+
runs-on: ubuntu-24.04
202+
needs:
203+
- build-dockerhub-stage
204+
steps:
205+
-
206+
name: Builder outputs
207+
uses: actions/github-script@v8
208+
env:
209+
INPUT_BUILDER-OUTPUTS: ${{ toJSON(needs.build-dockerhub-stage.outputs) }}
210+
with:
211+
script: |
212+
const builderOutputs = JSON.parse(core.getInput('builder-outputs'));
213+
core.info(JSON.stringify(builderOutputs, null, 2));
214+
155215
build-dockerhub-stage-oidc:
156216
uses: ./.github/workflows/build.yml
157217
permissions:
@@ -186,6 +246,21 @@ jobs:
186246
- registry: registry-1-stage.docker.io
187247
username: docker:cdeb5882-30b7-4076-be92-bfdceb258e9c
188248
249+
build-dockerhub-stage-oidc-outputs:
250+
runs-on: ubuntu-24.04
251+
needs:
252+
- build-dockerhub-stage-oidc
253+
steps:
254+
-
255+
name: Builder outputs
256+
uses: actions/github-script@v8
257+
env:
258+
INPUT_BUILDER-OUTPUTS: ${{ toJSON(needs.build-dockerhub-stage-oidc.outputs) }}
259+
with:
260+
script: |
261+
const builderOutputs = JSON.parse(core.getInput('builder-outputs'));
262+
core.info(JSON.stringify(builderOutputs, null, 2));
263+
189264
build-ghcr-and-aws:
190265
uses: ./.github/workflows/build.yml
191266
permissions:
@@ -228,6 +303,21 @@ jobs:
228303
username: ${{ secrets.AWS_ACCESS_KEY_ID }}
229304
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
230305
306+
build-ghcr-and-aws-outputs:
307+
runs-on: ubuntu-24.04
308+
needs:
309+
- build-ghcr-and-aws
310+
steps:
311+
-
312+
name: Builder outputs
313+
uses: actions/github-script@v8
314+
env:
315+
INPUT_BUILDER-OUTPUTS: ${{ toJSON(needs.build-ghcr-and-aws.outputs) }}
316+
with:
317+
script: |
318+
const builderOutputs = JSON.parse(core.getInput('builder-outputs'));
319+
core.info(JSON.stringify(builderOutputs, null, 2));
320+
231321
build-local:
232322
uses: ./.github/workflows/build.yml
233323
permissions:
@@ -249,6 +339,21 @@ jobs:
249339
with:
250340
builder-outputs: ${{ toJSON(needs.build-local.outputs) }}
251341

342+
build-local-outputs:
343+
runs-on: ubuntu-24.04
344+
needs:
345+
- build-local
346+
steps:
347+
-
348+
name: Builder outputs
349+
uses: actions/github-script@v8
350+
env:
351+
INPUT_BUILDER-OUTPUTS: ${{ toJSON(needs.local.outputs) }}
352+
with:
353+
script: |
354+
const builderOutputs = JSON.parse(core.getInput('builder-outputs'));
355+
core.info(JSON.stringify(builderOutputs, null, 2));
356+
252357
build-local-single:
253358
uses: ./.github/workflows/build.yml
254359
permissions:
@@ -269,6 +374,21 @@ jobs:
269374
with:
270375
builder-outputs: ${{ toJSON(needs.build-local-single.outputs) }}
271376

377+
build-local-single-outputs:
378+
runs-on: ubuntu-24.04
379+
needs:
380+
- build-local-single
381+
steps:
382+
-
383+
name: Builder outputs
384+
uses: actions/github-script@v8
385+
env:
386+
INPUT_BUILDER-OUTPUTS: ${{ toJSON(needs.build-local-single.outputs) }}
387+
with:
388+
script: |
389+
const builderOutputs = JSON.parse(core.getInput('builder-outputs'));
390+
core.info(JSON.stringify(builderOutputs, null, 2));
391+
272392
build-set-runner:
273393
uses: ./.github/workflows/build.yml
274394
permissions:
@@ -320,6 +440,21 @@ jobs:
320440
username: ${{ secrets.AWS_ACCESS_KEY_ID }}
321441
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
322442
443+
bake-aws-single-outputs:
444+
runs-on: ubuntu-24.04
445+
needs:
446+
- bake-aws-single
447+
steps:
448+
-
449+
name: Builder outputs
450+
uses: actions/github-script@v8
451+
env:
452+
INPUT_BUILDER-OUTPUTS: ${{ toJSON(needs.bake-aws-single.outputs) }}
453+
with:
454+
script: |
455+
const builderOutputs = JSON.parse(core.getInput('builder-outputs'));
456+
core.info(JSON.stringify(builderOutputs, null, 2));
457+
323458
bake-aws:
324459
uses: ./.github/workflows/bake.yml
325460
permissions:
@@ -356,6 +491,21 @@ jobs:
356491
username: ${{ secrets.AWS_ACCESS_KEY_ID }}
357492
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
358493
494+
bake-aws-outputs:
495+
runs-on: ubuntu-24.04
496+
needs:
497+
- bake-aws
498+
steps:
499+
-
500+
name: Builder outputs
501+
uses: actions/github-script@v8
502+
env:
503+
INPUT_BUILDER-OUTPUTS: ${{ toJSON(needs.bake-aws.outputs) }}
504+
with:
505+
script: |
506+
const builderOutputs = JSON.parse(core.getInput('builder-outputs'));
507+
core.info(JSON.stringify(builderOutputs, null, 2));
508+
359509
bake-ghcr-and-aws:
360510
uses: ./.github/workflows/bake.yml
361511
permissions:
@@ -400,6 +550,21 @@ jobs:
400550
username: ${{ secrets.AWS_ACCESS_KEY_ID }}
401551
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
402552
553+
bake-ghcr-and-aws-outputs:
554+
runs-on: ubuntu-24.04
555+
needs:
556+
- bake-ghcr-and-aws
557+
steps:
558+
-
559+
name: Builder outputs
560+
uses: actions/github-script@v8
561+
env:
562+
INPUT_BUILDER-OUTPUTS: ${{ toJSON(needs.bake-ghcr-and-aws.outputs) }}
563+
with:
564+
script: |
565+
const builderOutputs = JSON.parse(core.getInput('builder-outputs'));
566+
core.info(JSON.stringify(builderOutputs, null, 2));
567+
403568
bake-local:
404569
uses: ./.github/workflows/bake.yml
405570
permissions:
@@ -422,6 +587,21 @@ jobs:
422587
with:
423588
builder-outputs: ${{ toJSON(needs.bake-local.outputs) }}
424589

590+
bake-local-outputs:
591+
runs-on: ubuntu-24.04
592+
needs:
593+
- bake-local
594+
steps:
595+
-
596+
name: Builder outputs
597+
uses: actions/github-script@v8
598+
env:
599+
INPUT_BUILDER-OUTPUTS: ${{ toJSON(needs.bake-local.outputs) }}
600+
with:
601+
script: |
602+
const builderOutputs = JSON.parse(core.getInput('builder-outputs'));
603+
core.info(JSON.stringify(builderOutputs, null, 2));
604+
425605
bake-local-single:
426606
uses: ./.github/workflows/bake.yml
427607
permissions:
@@ -444,6 +624,21 @@ jobs:
444624
with:
445625
builder-outputs: ${{ toJSON(needs.bake-local-single.outputs) }}
446626

627+
bake-local-single-outputs:
628+
runs-on: ubuntu-24.04
629+
needs:
630+
- bake-local-single
631+
steps:
632+
-
633+
name: Builder outputs
634+
uses: actions/github-script@v8
635+
env:
636+
INPUT_BUILDER-OUTPUTS: ${{ toJSON(needs.bake-local-single.outputs) }}
637+
with:
638+
script: |
639+
const builderOutputs = JSON.parse(core.getInput('builder-outputs'));
640+
core.info(JSON.stringify(builderOutputs, null, 2));
641+
447642
bake-set-runner:
448643
uses: ./.github/workflows/bake.yml
449644
permissions:

.github/workflows/bake.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,17 +125,20 @@ on:
125125
description: "GitHub Token used to authenticate against a repository for Git context"
126126
required: false
127127
outputs:
128+
meta-json:
129+
description: "Metadata JSON output (only for image output)"
130+
value: ${{ jobs.finalize.outputs.meta-json }}
128131
cosign-version:
129-
description: Cosign version used for verification
132+
description: "Cosign version used for verification"
130133
value: ${{ jobs.finalize.outputs.cosign-version }}
131134
cosign-verify-commands:
132-
description: Cosign verify commands
135+
description: "Cosign verify commands"
133136
value: ${{ jobs.finalize.outputs.cosign-verify-commands }}
134137
artifact-name:
135-
description: Name of the uploaded artifact (for local output)
138+
description: "Name of the uploaded artifact (for local output)"
136139
value: ${{ jobs.finalize.outputs.artifact-name }}
137140
output-type:
138-
description: Build output type
141+
description: "Build output type"
139142
value: ${{ jobs.finalize.outputs.output-type }}
140143

141144
env:
@@ -661,6 +664,7 @@ jobs:
661664
finalize:
662665
runs-on: ubuntu-24.04
663666
outputs:
667+
meta-json: ${{ steps.meta.outputs.json }}
664668
cosign-version: ${{ env.COSIGN_VERSION }}
665669
cosign-verify-commands: ${{ steps.set.outputs.cosign-verify-commands }}
666670
artifact-name: ${{ inputs.artifact-name }}

.github/workflows/build.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,17 +136,20 @@ on:
136136
description: "GitHub Token used to authenticate against a repository for Git context"
137137
required: false
138138
outputs:
139+
meta-json:
140+
description: "Metadata JSON output (only for image output)"
141+
value: ${{ jobs.finalize.outputs.meta-json }}
139142
cosign-version:
140-
description: Cosign version used for verification
143+
description: "Cosign version used for verification"
141144
value: ${{ jobs.finalize.outputs.cosign-version }}
142145
cosign-verify-commands:
143-
description: Cosign verify commands
146+
description: "Cosign verify commands"
144147
value: ${{ jobs.finalize.outputs.cosign-verify-commands }}
145148
artifact-name:
146-
description: Name of the uploaded artifact (for local output)
149+
description: "Name of the uploaded artifact (for local output)"
147150
value: ${{ jobs.finalize.outputs.artifact-name }}
148151
output-type:
149-
description: Build output type
152+
description: "Build output type"
150153
value: ${{ jobs.finalize.outputs.output-type }}
151154

152155
env:
@@ -555,6 +558,7 @@ jobs:
555558
finalize:
556559
runs-on: ubuntu-24.04
557560
outputs:
561+
meta-json: ${{ steps.meta.outputs.json }}
558562
cosign-version: ${{ env.COSIGN_VERSION }}
559563
cosign-verify-commands: ${{ steps.set.outputs.cosign-verify-commands }}
560564
artifact-name: ${{ inputs.artifact-name }}

0 commit comments

Comments
 (0)