From 9c10ad4c85698f3a45b1089746e57cfc837a0f8b Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Tue, 27 Feb 2024 18:32:17 +0100 Subject: [PATCH] only sign into docker hub if username set --- .github/workflows/docker.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 287dcd4f26..32f5917bef 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -122,11 +122,13 @@ jobs: if: github.event_name != 'pull_request' uses: sigstore/cosign-installer@11086d25041f77fe8fe7b9ea4e48e3b9192b8f19 # pin@v3.1.2 - name: Login to Dockerhub - if: github.event_name != 'pull_request' + if: github.event_name != 'pull_request' && ${{ env.username != '' }} uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # pin@v3.0.0 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} + env: + username: ${{ secrets.DOCKER_USERNAME }} - name: Log into registry ghcr.io if: github.event_name != 'pull_request'