This commit is contained in:
7
check.sh
7
check.sh
@@ -52,8 +52,7 @@ if [ -z "${TARGET_REGISTRY_API}" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "${REGISTRY_URL}" ]; then
|
if [ -z "${REGISTRY_URL}" ]; then
|
||||||
REGISTRY_URL="https://hub.docker.com/v2"
|
REGISTRY_URL="https://hub.docker.com"
|
||||||
# repositories
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "${BASE_REGISTRY_URL}" ]; then
|
if [ -z "${BASE_REGISTRY_URL}" ]; then
|
||||||
@@ -91,7 +90,7 @@ if [ "${BASE_REGISTRY_API}" = 'docker' ];then
|
|||||||
TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d "{\"username\": \"${BASE_REGISTRY_USERNAME}\", \"password\": \"${BASE_REGISTRY_PASSWORD}\"}" "${BASE_REGISTRY_URL}/users/login/" | jq -r .token)
|
TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d "{\"username\": \"${BASE_REGISTRY_USERNAME}\", \"password\": \"${BASE_REGISTRY_PASSWORD}\"}" "${BASE_REGISTRY_URL}/users/login/" | jq -r .token)
|
||||||
BASE_HEADER="Authorization: JWT ${TOKEN}"
|
BASE_HEADER="Authorization: JWT ${TOKEN}"
|
||||||
fi
|
fi
|
||||||
BASE_URL="${BASE_REGISTRY_URL}/${BASE_REPO_USER}/${BASE_REPO_NAME}/tags/${BASE_REPO_TAG}"
|
BASE_URL="${BASE_REGISTRY_URL}/v2/repositories/${BASE_REPO_USER}/${BASE_REPO_NAME}/tags/${BASE_REPO_TAG}"
|
||||||
|
|
||||||
elif [ "${BASE_REGISTRY_API}" = 'gitea' ];then
|
elif [ "${BASE_REGISTRY_API}" = 'gitea' ];then
|
||||||
if [ -n "${BASE_REGISTRY_PASSWORD}" ]; then
|
if [ -n "${BASE_REGISTRY_PASSWORD}" ]; then
|
||||||
@@ -107,7 +106,7 @@ if [ "${TARGET_REGISTRY_API}" = 'docker' ];then
|
|||||||
TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d "{\"username\": \"${TARGET_REGISTRY_USERNAME}\", \"password\": \"${TARGET_REGISTRY_PASSWORD}\"}" "${TARGET_REGISTRY_URL}/users/login/" | jq -r .token)
|
TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d "{\"username\": \"${TARGET_REGISTRY_USERNAME}\", \"password\": \"${TARGET_REGISTRY_PASSWORD}\"}" "${TARGET_REGISTRY_URL}/users/login/" | jq -r .token)
|
||||||
TARGET_HEADER="Authorization: JWT ${TOKEN}"
|
TARGET_HEADER="Authorization: JWT ${TOKEN}"
|
||||||
fi
|
fi
|
||||||
TARGET_URL="${TARGET_REGISTRY_URL}/${TARGET_REPO_USER}/${TARGET_REPO_NAME}/tags/${TARGET_REPO_TAG}"
|
TARGET_URL="${TARGET_REGISTRY_URL}/v2/repositories/${TARGET_REPO_USER}/${TARGET_REPO_NAME}/tags/${TARGET_REPO_TAG}"
|
||||||
|
|
||||||
elif [ "${TARGET_REGISTRY_API}" = 'gitea' ];then
|
elif [ "${TARGET_REGISTRY_API}" = 'gitea' ];then
|
||||||
if [ -n "${TARGET_REGISTRY_PASSWORD}" ]; then
|
if [ -n "${TARGET_REGISTRY_PASSWORD}" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user