constellation/.github/actions/container_registry_login/action.yml
renovate[bot] 0e7462728a
deps: update docker/login-action action to v3 (#2511)
Co-authored-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
2023-10-25 17:40:25 +02:00

36 lines
1.1 KiB
YAML

name: Create container registry login credentials file
description: Delete previously created IAM configuration.
inputs:
registry:
description: "Container registry to use"
required: true
username:
description: "Username used for authentication."
required: true
password:
description: "Password used for authentication."
required: true
runs:
using: "composite"
steps:
- name: Use docker for logging in
if: runner.os != 'macOS'
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: ${{ inputs.registry }}
username: ${{ inputs.username }}
password: ${{ inputs.password }}
- name: Manually create docker config.json
if: runner.os == 'macOS'
shell: bash
env:
REGISTRY: ${{ inputs.registry }}
USERNAME: ${{ inputs.username }}
PASSWORD: ${{ inputs.password }}
run: |
mkdir -p ~/.docker
echo "{\"auths\":{\"${REGISTRY}\":{\"username\":\"${USERNAME}\",\"password\":\"${PASSWORD}\"}}}" | tee ~/.docker/config.json