From 567d9d98a5cea93d700e209bf192e569463e3fea Mon Sep 17 00:00:00 2001 From: Tim Schumacher Date: Tue, 12 Sep 2023 12:54:41 +0200 Subject: [PATCH] Don't push to the container registry for pull requests --- .github/workflows/docker.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 7db8a04..2a91920 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -27,6 +27,7 @@ jobs: - name: Login to GitHub Container Registry uses: docker/login-action@v1 + if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' with: registry: ghcr.io username: ${{ github.repository_owner }} @@ -37,7 +38,7 @@ jobs: with: context: . platforms: linux/amd64,linux/arm64 - push: true + push: ${{ github.ref == 'refs/heads/main' && github.event_name != 'pull_request' }} pull: true tags: | ghcr.io/${{ github.repository }}:latest