From 063f900eee8770c2198a2aba0585b2d91f5dd500 Mon Sep 17 00:00:00 2001 From: Florian Trayon <26360935+FlorianLeChat@users.noreply.github.com> Date: Fri, 2 Aug 2024 20:39:22 +0200 Subject: [PATCH] Fixed Docker image compilation when a pull request is merged --- .github/workflows/docker-image.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 244497b..6101f9f 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -29,17 +29,16 @@ jobs: tags: | type=sha - name: Login to GitHub Container Registry - if: github.event_name == 'push' || ( github.event_name == 'pull_request' && github.event.pull_request.user.login == 'github-actions[bot]' && github.event.pull_request.merged ) + if: github.event_name != 'pull_request' uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build Docker Image and push - if: github.event_name == 'push' || ( github.event_name == 'pull_request' && github.event.pull_request.user.login == 'github-actions[bot]' && github.event.pull_request.merged ) uses: docker/build-push-action@v6 with: - push: true + push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} context: .