Added colors
This commit is contained in:
13
action.yml
13
action.yml
@@ -22,9 +22,10 @@ runs:
|
||||
- name: Docker login
|
||||
shell: sh
|
||||
run: |
|
||||
source /load-tools.sh
|
||||
export PREFIXLESS_REGISTRY=$(echo -n "${{ inputs.registry }}" | sed 's/^https\?:\/\///')
|
||||
|
||||
echo Checking credentials validity for ${PREFIXLESS_REGISTRY}...
|
||||
write "$(bold_blue)Checking credentials validity for ${PREFIXLESS_REGISTRY}..."
|
||||
export BASE64_AUTH=$(echo -n "${{ inputs.user }}:${{ inputs.pass }}" | base64 -w 0)
|
||||
|
||||
response=$(curl -s -w "\n%{http_code}" \
|
||||
@@ -36,13 +37,13 @@ runs:
|
||||
response_body=$(echo "$response" | head -n -1)
|
||||
|
||||
if [ "$http_code" -eq 200 ]; then
|
||||
echo "Authentication successful"
|
||||
write "$(bold_green)"Authentication successful"
|
||||
else
|
||||
echo "Authentication failed with HTTP code: $http_code"
|
||||
echo "Response body:"
|
||||
echo "$response_body"
|
||||
write "$(bold_red)Authentication failed with HTTP code: $http_code"
|
||||
write "$(red)Response body:"
|
||||
write "$(red)$response_body"
|
||||
if [ "$http_code" -eq 401 ]; then
|
||||
echo "The identifiers are probably wrong"
|
||||
write "$(yellow)The identifiers are probably wrong"
|
||||
fi
|
||||
exit 1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user