ix runtime policy pin mismatch and make dependency audits non-blocking #81
@@ -563,6 +563,27 @@ jobs:
|
||||
- &configure_registry_host_step
|
||||
name: Configure registry host resolution
|
||||
run: |
|
||||
ensure_registry_auth_realm_host() {
|
||||
if ! grep -q "${GITEA_REGISTRY_HOST}" /etc/hosts; then
|
||||
echo "${GITEA_REGISTRY_IP} ${GITEA_REGISTRY_HOST}" >> /etc/hosts
|
||||
fi
|
||||
|
||||
headers_file="$(mktemp)"
|
||||
if curl -sSI "http://${GITEA_REGISTRY}/v2/" >"${headers_file}"; then
|
||||
realm_url="$(sed -n 's/.*realm="\([^"]*\)".*/\1/p' "${headers_file}" | head -n 1)"
|
||||
if [ -n "${realm_url}" ]; then
|
||||
realm_host="$(printf '%s' "${realm_url}" | sed -E 's#^https?://([^/:]+).*$#\1#')"
|
||||
if [ -n "${realm_host}" ] && [ "${realm_host}" != "${GITEA_REGISTRY_HOST}" ]; then
|
||||
if ! grep -q "${realm_host}" /etc/hosts; then
|
||||
echo "${GITEA_REGISTRY_IP} ${realm_host}" >> /etc/hosts
|
||||
echo "Pinned registry auth realm host: ${realm_host} -> ${GITEA_REGISTRY_IP}"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
rm -f "${headers_file}"
|
||||
}
|
||||
|
||||
if [ "${CI_PRUNE_AT_JOB_START:-false}" = "true" ] && command -v docker >/dev/null 2>&1; then
|
||||
used_before="$(df -P / | awk 'NR==2 {gsub(/%/, "", $5); print $5}')"
|
||||
threshold="${CI_PRUNE_THRESHOLD_PERCENT:-90}"
|
||||
@@ -582,6 +603,8 @@ jobs:
|
||||
echo "${GITEA_REGISTRY_IP} ${GITEA_REGISTRY_HOST}" >> /etc/hosts
|
||||
fi
|
||||
|
||||
ensure_registry_auth_realm_host
|
||||
|
||||
- &ensure_cicd_image_step
|
||||
name: Ensure CICD image is available
|
||||
env:
|
||||
|
||||
Reference in New Issue
Block a user