Fix: make registry login conditional inside step instead of using if: on step

This commit is contained in:
Hermes
2026-05-02 16:52:54 -07:00
parent bbd07b045f
commit c092e90c3c

View File

@@ -113,9 +113,10 @@ runs:
- name: Log in to Docker registry
shell: bash
if: inputs.push == 'true' && inputs.registry != ''
run: |
echo "${{ inputs.registry-password }}" | docker login ${{ inputs.registry }} -u ${{ inputs.registry-username }} --password-stdin
if [ -n "${{ inputs.registry }}" ] && [ -n "${{ inputs.registry-password }}" ]; then
echo "${{ inputs.registry-password }}" | docker login ${{ inputs.registry }} -u ${{ inputs.registry-username }} --password-stdin || echo "Login failed or not needed"
fi
- name: Build image
id: build