Skip to content

Commit 5d8ba52

Browse files
authored
fix: expose enable-edge-tag on reusable workflow (#1098)
* fix: expose enable-edge-tag on reusable workflow * chore: fix coupling of input
1 parent e5651d1 commit 5d8ba52

4 files changed

Lines changed: 13 additions & 4 deletions

File tree

.github/workflows/continuous-integration.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
pull-requests: write # is needed by marocchino/sticky-pull-request-comment to post comments
2626
with:
2727
dockerfile: .devcontainer/base/Dockerfile
28+
enable-edge-tag: ${{ github.event_name == 'merge_group' }}
2829
image-name: ${{ github.repository }}-base
2930
integration-test-file: test/base/integration-tests.bats
3031

@@ -52,6 +53,7 @@ jobs:
5253
BASE_IMAGE=${{ needs.build-push-base.outputs.fully-qualified-image-name }}@${{ needs.build-push-base.outputs.digest }}
5354
devcontainer-metadata-file: .devcontainer/${{ matrix.flavor }}/devcontainer-metadata.json
5455
dockerfile: .devcontainer/${{ matrix.flavor }}/Dockerfile
56+
enable-edge-tag: ${{ github.event_name == 'merge_group' }}
5557
image-name: ${{ github.repository }}-${{ matrix.flavor }}
5658
integration-test-file: test/${{ matrix.flavor }}/integration-tests.bats
5759
acceptance-test-path: ${{ matrix.flavor == 'cpp' && 'test/cpp/features' || '' }}

.github/workflows/release-build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
with:
2727
dockerfile: .devcontainer/base/Dockerfile
2828
image-name: ${{ github.repository }}-base
29+
integration-test-file: test/base/integration-tests.bats
2930

3031
build-push-flavors:
3132
name: Build → Push → Test (🍨 ${{ matrix.flavor }})

.github/workflows/wc-build-push-test.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ on:
3737
description: Path to the Dockerfile to build
3838
required: true
3939
type: string
40+
enable-edge-tag:
41+
description: Whether to also build and push an "edge" tag for the image
42+
required: false
43+
type: boolean
44+
default: false
4045
image-name:
4146
description: >-
4247
Name of the Docker image to build, without registry or tag.
@@ -116,6 +121,7 @@ jobs:
116121
with:
117122
build-args: ${{ inputs.build-args }}
118123
dockerfile: ${{ inputs.dockerfile }}
124+
enable-edge-tag: ${{ inputs.enable-edge-tag }}
119125
registry: ${{ inputs.registry }}
120126
image-name: ${{ inputs.image-name }}
121127
devcontainer-metadata-file: ${{ inputs.devcontainer-metadata-file }}

.github/workflows/wc-build-push.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ on:
2626
dockerfile:
2727
required: true
2828
type: string
29+
enable-edge-tag:
30+
required: true
31+
type: boolean
2932
image-name:
3033
required: true
3134
type: string
@@ -182,11 +185,8 @@ jobs:
182185
with:
183186
images: ${{ needs.sanitize-image-name.outputs.fully-qualified-image-name }}
184187
# Generate Docker tags based on the following events/attributes.
185-
# To prevent unnecessary image builds we simulate the `type=edge` tag
186-
# with `type=raw,value=edge,enable=...` which only enables the tag
187-
# for a `merge_group` event, this removes the need to build on `push`.
188188
tags: |
189-
type=raw,value=edge,enable=${{ github.event_name == 'merge_group' }}
189+
type=raw,value=edge,enable=${{ inputs.enable-edge-tag }}
190190
type=ref,event=pr
191191
type=semver,pattern={{raw}}
192192
type=semver,pattern={{version}}

0 commit comments

Comments
 (0)