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