generated from pmo-actions/healthchecks-ping
Actualiser action.yaml
This commit is contained in:
20
action.yaml
20
action.yaml
@@ -1,8 +1,12 @@
|
|||||||
name: 'Connect to a docker registry'
|
name: 'Connect to a docker registry'
|
||||||
description: 'Connection to a docker registry using podman'
|
description: 'Connection to a docker registry using podman or docker'
|
||||||
author: 'Eric Coissac'
|
author: 'Eric Coissac'
|
||||||
|
|
||||||
inputs:
|
inputs:
|
||||||
|
registry_command:
|
||||||
|
description: 'command used to realise the login'
|
||||||
|
required: false
|
||||||
|
default: 'podman'
|
||||||
registry_server:
|
registry_server:
|
||||||
description: 'Address of the image registry server'
|
description: 'Address of the image registry server'
|
||||||
required: false
|
required: false
|
||||||
@@ -22,10 +26,18 @@ runs:
|
|||||||
- name: Podman connection to the registry
|
- name: Podman connection to the registry
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
echo "Connection to registry: ${{ inputs.registry_server }}..."
|
GREEN='\033[0;32m'
|
||||||
podman login ${{ inputs.registry_server }} \
|
RED='\033[0;31m'
|
||||||
|
NC='\033[0m' # No Color
|
||||||
|
if [[ -z $(which ${{ inputs.registry_command }}) ]] ; then
|
||||||
|
echo -e "${RED}❌ Error:${NC}: Cannot locate the ${{ inputs.registry_command }} command"
|
||||||
|
echo "${{ inputs.registry_command }} connection to registry: ${{ inputs.registry_server }}..."
|
||||||
|
result=$(${{ inputs.registry_command }} login ${{ inputs.registry_server }} \
|
||||||
-u ${{ inputs.registry_user }} \
|
-u ${{ inputs.registry_user }} \
|
||||||
-p ${{ inputs.registry_password }}
|
-p ${{ inputs.registry_password }}) \
|
||||||
|
&& echo -e "${GREEN}✅ $result:${NC}" \
|
||||||
|
|| echo -e "${RED}❌ Error:${NC}"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user