@@ -17,6 +17,7 @@ defaults:
1717 shell : bash
1818
1919env :
20+ PUSH : ${{ github.event == 'push' && github.ref_type == 'branch' && github.ref_name == github.event.repository.default_branch }}
2021 CONTAINER_REGISTRY : ghcr.io
2122 BUILDKIT_PROGRESS : plain
2223 CONAN_VERSION : 2.19.1
@@ -161,21 +162,21 @@ jobs:
161162 BASE_IMAGE=${{ env.CONTAINER_IMAGE_GCC && format('{0}@{1}', env.CONTAINER_IMAGE_GCC, steps.build-gcc.outputs.digest) || format('gcc:{0}-{1}', matrix.os.compiler_version, matrix.os.release) }}
162163 context : .
163164 file : docker/debian/Dockerfile
164- outputs : type=image,name=${{ env.CONTAINER_IMAGE }},push-by-digest=true,name-canonical=true,push=true
165+ outputs : type=image,name=${{ env.CONTAINER_IMAGE }},push-by-digest=true,name-canonical=true,push=${{ env.PUSH }}
165166 platforms : ${{ matrix.architecture.platform }}
166167 provenance : mode=max
167- push : ${{ github.ref_type == 'branch' && github.ref_name == github.event.repository.default_branch }}
168+ push : ${{ env.PUSH }}
168169 sbom : true
169170 labels : ${{ steps.meta.outputs.labels }}
170171 target : ${{ matrix.os.compiler_name }}
171172 - name : Export digest
172- if : ${{ github.ref_type == 'branch' && github.ref_name == github.event.repository.default_branch }}
173+ if : ${{ env.PUSH }}
173174 run : |
174175 mkdir -p /tmp/digests
175176 DIGEST="${{ steps.build.outputs.digest }}"
176177 touch "/tmp/digests/${DIGEST#sha256:}"
177178 - name : Upload digest
178- if : ${{ github.ref_type == 'branch' && github.ref_name == github.event.repository.default_branch }}
179+ if : ${{ env.PUSH }}
179180 uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
180181 with :
181182 name : digests-${{ matrix.os.release }}-${{ matrix.os.compiler_name }}-${{ matrix.os.compiler_version }}-${{ env.PLATFORM_PAIR }}
@@ -184,7 +185,7 @@ jobs:
184185 retention-days : 1
185186
186187 merge :
187- if : ${{ github.ref_type == 'branch' && github.ref_name == github.event.repository.default_branch }}
188+ if : ${{ github.event == 'push' && github. ref_type == 'branch' && github.ref_name == github.event.repository.default_branch }}
188189 strategy :
189190 matrix :
190191 os :
0 commit comments