From 805dccf3e960bf6fd3c3917fbb70e658d1823d91 Mon Sep 17 00:00:00 2001 From: TJWater CI Date: Fri, 7 Aug 2026 17:40:29 +0800 Subject: [PATCH] fix(ci): use preloaded cache on restricted runners --- .gitea/workflows/container-cd.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/container-cd.yml b/.gitea/workflows/container-cd.yml index 7b83727..ea07ebe 100644 --- a/.gitea/workflows/container-cd.yml +++ b/.gitea/workflows/container-cd.yml @@ -61,8 +61,10 @@ jobs: set -eu registry="$(printf '%s' '${{ inputs.image_name }}' | cut -d/ -f1)" printf '%s' "$REGISTRY_PASSWORD" | docker login "$registry" -u "$REGISTRY_USERNAME" --password-stdin - if [ -n "${{ inputs.cache_image }}" ]; then - docker pull "${{ inputs.cache_image }}" + if [ -n "${{ inputs.cache_image }}" ] && ! docker image inspect "${{ inputs.cache_image }}" >/dev/null 2>&1; then + echo "Required CI cache image is not present on this Runner: ${{ inputs.cache_image }}" + echo "Import the cache image locally before starting this workflow." + exit 1 fi - name: Build immutable candidate image run: |