From 913dea84af1b3b7daae3c73fed39f3dc5225b7db Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Thu, 21 Jul 2022 15:32:00 +0300 Subject: [PATCH] workflows: don't login to Docker Hub when not pushing images Minor safety improvement, images are not pushed anyway in this case, but it makes little sense logging in as well. --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c53bdaae7..2e165eacb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -93,6 +93,7 @@ jobs: uses: docker/setup-buildx-action@v2 - name: Login to DockerHub + if: ${{ github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.push_image == 'true') }} uses: docker/login-action@v2 with: username: ${{ secrets.DOCKERHUB_USERNAME }} @@ -136,6 +137,7 @@ jobs: cache: true - name: Login to DockerHub + if: ${{ github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.push_image == 'true') }} uses: docker/login-action@v2 with: username: ${{ secrets.DOCKERHUB_USERNAME }}