Updated with the new tools

This commit is contained in:
2024-12-21 16:55:10 +01:00
parent 0a4b7d7785
commit b634fa47f4

View File

@@ -22,10 +22,9 @@ 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\?:\/\///')
write "$(bold_blue)Checking credentials validity for ${PREFIXLESS_REGISTRY}..." log_info "$(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}" \
@@ -37,13 +36,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
write "$(bold_green)Authentication successful" log_info "$(bold_green)Authentication successful"
else else
write "$(bold_red)Authentication failed with HTTP code: $http_code" log_info "$(bold_red)Authentication failed with HTTP code: $http_code"
write "$(red)Response body:" log_info "$(red)Response body:"
write "$(red)$response_body" log_info "$(red)$response_body"
if [ "$http_code" -eq 401 ]; then if [ "$http_code" -eq 401 ]; then
write "$(yellow)The identifiers are probably wrong" log_info "$(yellow)The identifiers are probably wrong"
fi fi
exit 1 exit 1
fi fi