File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments