Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 14 additions & 15 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,20 @@ runs:
cache_scope="image-$(printf '%s' "$INPUTS_IMAGE" | sha256sum | cut -c1-16)"
echo "cache_scope=$cache_scope" >> "$GITHUB_OUTPUT"

- name: Login to ${{ steps.image.outputs.registry }}
uses: docker/login-action@af1e73f918a031802d376d3c8bbc3fe56130a9b0 # v4.4.0
if: ${{ inputs.username != '' && inputs.password != '' }}
with:
registry: ${{ steps.image.outputs.registry }}
username: ${{ inputs.username }}
password: ${{ inputs.password }}

- name: ACR Login
if: ${{ contains(steps.image.outputs.registry , '.azurecr.io') && inputs.password == ''}}
shell: bash
env:
STEPS_IMAGE_OUTPUTS_REGISTRY: ${{ steps.image.outputs.registry }}
run: az acr login --name ${STEPS_IMAGE_OUTPUTS_REGISTRY}

- name: Build image (local load for scanning)
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0
Expand Down Expand Up @@ -157,21 +171,6 @@ runs:
done <<< "$IMAGE_TAGS"
rm -rf /tmp/docker-scout "$HOME/.cache/java-db" "$HOME/.docker/scout"

- name: Login to ${{ steps.image.outputs.registry }}
uses: docker/login-action@af1e73f918a031802d376d3c8bbc3fe56130a9b0 # v4.4.0
if: ${{ inputs.username != '' && inputs.password != '' }}
with:
registry: ${{ steps.image.outputs.registry }}
username: ${{ inputs.username }}
password: ${{ inputs.password }}

- name: ACR Login
if: ${{ contains(steps.image.outputs.registry , '.azurecr.io') }}
shell: bash
env:
STEPS_IMAGE_OUTPUTS_REGISTRY: ${{ steps.image.outputs.registry }}
run: az acr login --name ${STEPS_IMAGE_OUTPUTS_REGISTRY}

- name: Push image with attestations
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0
with:
Expand Down