Skip to content

Commit 1a5b384

Browse files
committed
ci: 修复语法错误
1 parent 78a2d65 commit 1a5b384

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ jobs:
124124

125125
# 如果配置了 Docker Hub secrets,则登录
126126
- name: Login to Docker Hub
127-
if: ${{ secrets.DOCKER_USERNAME && secrets.DOCKER_PASSWORD }}
127+
if: ${{ secrets.DOCKER_USERNAME != '' && secrets.DOCKER_PASSWORD != '' }}
128128
uses: docker/login-action@v3
129129
with:
130130
username: ${{ secrets.DOCKER_USERNAME }}
@@ -148,7 +148,7 @@ jobs:
148148
context: .
149149
platforms: linux/amd64,linux/arm64
150150
# 只有在配置了 secrets 且是 main 分支时才推送
151-
push: ${{ secrets.DOCKER_USERNAME && secrets.DOCKER_PASSWORD && github.ref == 'refs/heads/main' }}
151+
push: ${{ secrets.DOCKER_USERNAME != '' && secrets.DOCKER_PASSWORD != '' && github.ref == 'refs/heads/main' }}
152152
tags: ${{ steps.meta.outputs.tags }}
153153
labels: ${{ steps.meta.outputs.labels }}
154154
cache-from: type=gha

0 commit comments

Comments
 (0)