From aa1a78cf8a4f2aed752efdf193389858043d1a10 Mon Sep 17 00:00:00 2001 From: josep-tecnativa Date: Fri, 7 Nov 2025 13:33:50 +0100 Subject: [PATCH] [FIX] Skip push on fork PRs --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4325252..cf3332e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -68,14 +68,14 @@ jobs: run: docker tag ${{ env.DOCKER_REPO }}:${{ matrix.pg_version }}-alpine ${{ env.DOCKER_REPO }}:${{ env.DOCKER_TAG }} # Push - name: Push Docker Image to Docker Hub - if: github.repository == 'Tecnativa/docker-postgres-autoconf' && (env.IS_PR || github.ref == 'refs/heads/master') + if: github.repository == 'Tecnativa/docker-postgres-autoconf' && (github.ref == 'refs/heads/master' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)) env: REGISTRY_HOST: docker.io REGISTRY_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} REGISTRY_USERNAME: ${{ secrets.DOCKERHUB_LOGIN }} run: ./hooks/push - name: Push Docker Image to GitHub Registry - if: github.repository == 'Tecnativa/docker-postgres-autoconf' && (env.IS_PR || github.ref == 'refs/heads/master') + if: github.repository == 'Tecnativa/docker-postgres-autoconf' && (github.ref == 'refs/heads/master' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)) env: REGISTRY_HOST: ghcr.io REGISTRY_TOKEN: ${{ secrets.BOT_TOKEN }}