From bbfe8f8ef90f21d67546224cfb18f165bff93746 Mon Sep 17 00:00:00 2001 From: Malek Adawi <91701218+m-adawi@users.noreply.github.com> Date: Mon, 30 Sep 2024 22:41:47 +0300 Subject: [PATCH] fix: only login to DockerHub on changes to main --- .github/workflows/docker-ci.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-ci.yaml b/.github/workflows/docker-ci.yaml index 5148fe8..61c1355 100644 --- a/.github/workflows/docker-ci.yaml +++ b/.github/workflows/docker-ci.yaml @@ -47,6 +47,7 @@ jobs: - name: Login to Docker Hub uses: docker/login-action@v3 + if: ${{ github.ref_name == 'main' }} with: username: ${{ vars.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} @@ -68,4 +69,4 @@ jobs: with: username: ${{ vars.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - repository: ${{ vars.DOCKERHUB_USERNAME }}/swarm-cd \ No newline at end of file + repository: ${{ vars.DOCKERHUB_USERNAME }}/swarm-cd