Skip to content

Commit 935ecdd

Browse files
committed
add conditionals to steps, not job
so that the `test` job can use build-images job as a dependency. Otherwise, if build-images is skipped, test would be skipped.
1 parent ccee538 commit 935ecdd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.github/workflows/build-images.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ jobs:
6262
name: Build all images with podman
6363
runs-on: ubuntu-24.04
6464
needs: [ detect-existing ]
65-
if: ${{ needs.detect-existing.outputs.DO_BUILD == 'true' }}
6665
container:
6766
# travier/podman-action contains newer podman/buildah versions.
6867
image: quay.io/travier/podman-action
@@ -71,6 +70,7 @@ jobs:
7170
steps:
7271

7372
- name: Initial setup of podman-action container
73+
if: ${{ needs.detect-existing.outputs.DO_BUILD == 'true' }}
7474
run: |
7575
# support cross-arch container building
7676
podman run --rm --privileged docker.io/tonistiigi/binfmt --install arm64
@@ -97,6 +97,7 @@ jobs:
9797
fetch-depth: 0
9898

9999
- name: build all images
100+
if: ${{ needs.detect-existing.outputs.DO_BUILD == 'true' }}
100101
run: |
101102
# GHA is giving warning with a suggestion to do the following, even
102103
# though the checkout action should have already done this.
@@ -119,6 +120,7 @@ jobs:
119120
120121
# Upload the tarballs just created so they can be used in the next job.
121122
- name: Upload artifacts
123+
if: ${{ needs.detect-existing.outputs.DO_BUILD == 'true' }}
122124
uses: actions/upload-artifact@v4
123125
with:
124126
name: image-artifacts

0 commit comments

Comments
 (0)