Skip to content

Commit 5070e24

Browse files
committed
Add a push input to the multi-arch build workflow
The shared docker-build-multi-arch.yaml workflow always pushes the built image. It has no way to run a build-only check on a pull request. lago-self-billing needs that check: its own build must validate both architectures on a pull request, but must not push to ECR until the pull request merges. No caller of this workflow does that today. Add a push input, default true. Skip the push in the build step and skip the merge job when push is false. Every current caller omits this input, so the default keeps their build the same. Part of the arm64 image-coverage audit in INF-366.
1 parent 4955f79 commit 5070e24

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

.github/workflows/docker-build-multi-arch.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ on:
8181
type: string
8282
default: ''
8383

84+
push:
85+
description: 'Push the built image(s) to the registry. Set false for PR-only validation builds.'
86+
required: false
87+
type: boolean
88+
default: true
89+
8490
secrets:
8591
registry-user:
8692
description: 'Registry username or AWS Access Key ID'
@@ -277,7 +283,7 @@ jobs:
277283
platforms: linux/${{ matrix.arch }}
278284
build-args: ${{ inputs.build-args }}
279285
secrets: ${{ secrets.build-secrets }}
280-
outputs: type=image,name=${{ inputs.image-name }},push-by-digest=true,name-canonical=true,push=true
286+
outputs: type=image,name=${{ inputs.image-name }},push-by-digest=true,name-canonical=true,push=${{ inputs.push }}
281287
cache-from: ${{ inputs.cache-type != 'disabled' && format('type=registry,ref={0}:buildcache-{1}', inputs.image-name, matrix.arch) || '' }}
282288
cache-to: ${{ inputs.cache-type != 'disabled' && format('type=registry,ref={0}:buildcache-{1},mode=max', inputs.image-name, matrix.arch) || '' }}
283289
labels: ${{ steps.meta.outputs.labels }}
@@ -299,6 +305,7 @@ jobs:
299305
merge:
300306
runs-on: ubuntu-latest
301307
needs: [build]
308+
if: ${{ inputs.push }}
302309
outputs:
303310
image-tag: ${{ steps.summary.outputs.image-tag }}
304311
digest: ${{ steps.inspect.outputs.digest }}

0 commit comments

Comments
 (0)