Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

ci: avoid publishing Docker images from pull requests

Yudhi Armyndharis9833993a6878
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 8e8918f48..13cb3e2d4 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -213,6 +213,7 @@ jobs:
uses: docker/setup-buildx-action@v4
- name: Login to GitHub Container Registry
+ if: github.event_name == 'push'
uses: docker/login-action@v4
with:
registry: ghcr.io
@@ -229,11 +230,13 @@ jobs:
type=sha,prefix=
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
- - name: Build and push
+ - name: Build and optionally push
uses: docker/build-push-action@v7
with:
context: .
- push: true
+ # Fork pull requests receive a read-only token, so they validate both image architectures
+ # without publishing. Trusted branch pushes retain the existing GHCR publication behavior.
+ push: ${{ github.event_name == 'push' }}
platforms: ${{ env.DOCKER_PLATFORMS }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}