Skip to content

Commit

Permalink
ci: only attempt to log in into Docker when attempting to push to docker
Browse files Browse the repository at this point in the history
The values of environment variables are treated as strings.
Therefore, we need to do a string comparison.
  • Loading branch information
odzhychko committed Dec 18, 2024
1 parent ba4268e commit 3c6864b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ jobs:
# Try to log in early. If this fails, there's no reason to perform the remaining steps
- name: Log in to Docker Hub
# Only attempt to log in if we later attempt to push.
if: ${{ env.PUSH }}
if: ${{ env.PUSH == 'true' }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USER }}
Expand Down

0 comments on commit 3c6864b

Please sign in to comment.