From 9eab770e79145b13beaf035706f3652ac7bdbc18 Mon Sep 17 00:00:00 2001 From: bo0tzz Date: Mon, 17 Feb 2025 21:13:56 +0100 Subject: [PATCH] fix: don't push on forks (#16165) --- .github/workflows/docker.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index f703d479fc..f2a7afbac2 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -167,14 +167,12 @@ jobs: context: ${{ env.context }} file: ${{ env.file }} platforms: ${{ matrix.platforms }} - # Skip pushing when PR from a fork - push: ${{ !github.event.pull_request.head.repo.fork }} labels: ${{ steps.metadata.outputs.labels }} cache-to: type=registry,ref=${{ env.GHCR_REPO }}-build-cache:${{ env.PLATFORM_PAIR }}-${{ matrix.device }}-${{ env.CACHE_KEY_SUFFIX }},mode=max,compression=zstd cache-from: | type=registry,ref=${{ env.GHCR_REPO }}-build-cache:${{ env.PLATFORM_PAIR }}-${{ matrix.device }}-${{ env.CACHE_KEY_SUFFIX }} type=registry,ref=${{ env.GHCR_REPO }}-build-cache:${{ env.PLATFORM_PAIR }}-${{ matrix.device }}-main - outputs: type=image,"name=${{ env.GHCR_REPO }}",push-by-digest=true,name-canonical=true,push=true + outputs: type=image,"name=${{ env.GHCR_REPO }}",push-by-digest=true,name-canonical=true,push=${{ !github.event.pull_request.head.repo.fork }} build-args: | DEVICE=${{ matrix.device }} BUILD_ID=${{ github.run_id }} @@ -321,14 +319,12 @@ jobs: context: ${{ env.context }} file: ${{ env.file }} platforms: ${{ matrix.platform }} - # Skip pushing when PR from a fork - push: ${{ !github.event.pull_request.head.repo.fork }} labels: ${{ steps.metadata.outputs.labels }} cache-to: type=registry,ref=${{ env.GHCR_REPO }}-build-cache:${{ env.PLATFORM_PAIR }}-${{ env.CACHE_KEY_SUFFIX }},mode=max,compression=zstd cache-from: | type=registry,ref=${{ env.GHCR_REPO }}-build-cache:${{ env.PLATFORM_PAIR }}-${{ env.CACHE_KEY_SUFFIX }} type=registry,ref=${{ env.GHCR_REPO }}-build-cache:${{ env.PLATFORM_PAIR }}-main - outputs: type=image,"name=${{ env.GHCR_REPO }}",push-by-digest=true,name-canonical=true,push=true + outputs: type=image,"name=${{ env.GHCR_REPO }}",push-by-digest=true,name-canonical=true,push=${{ !github.event.pull_request.head.repo.fork }} build-args: | DEVICE=cpu BUILD_ID=${{ github.run_id }}