From 3475184dd52aaa791ff2152a13b53f8973c7519a Mon Sep 17 00:00:00 2001 From: Calvin Date: Tue, 13 Feb 2024 17:40:27 +0200 Subject: [PATCH] Runs the step if the event is a pull request, regardless of the branch. Runs the step if the event is a push, but only if the push is not to the main branch. Ensures that the step is skipped for any pushes directly to the main branch --- .github/workflows/docker_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker_build.yml b/.github/workflows/docker_build.yml index 2470d2a2bb..55b2adf8d4 100644 --- a/.github/workflows/docker_build.yml +++ b/.github/workflows/docker_build.yml @@ -36,7 +36,7 @@ jobs: uses: actions/checkout@v2 - name: Build Docker Image (No Push) - if: github.event_name == 'pull_request' || github.event_name == 'push' + if: github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref != 'refs/heads/main') uses: docker/build-push-action@v5.1.0 with: context: .