diff --git a/gitea_runner_base/Dockerfile b/gitea_runner_base/Dockerfile index f0375e8..abf00f0 100644 --- a/gitea_runner_base/Dockerfile +++ b/gitea_runner_base/Dockerfile @@ -48,11 +48,12 @@ RUN apk update && apk add --no-cache \ tree \ && rm -rf /var/cache/apk/* \ # 预装常用 GitHub Actions,避免每次执行都从 GitHub clone - && mkdir -p ${ACTIONS_CACHE_DIR} \ - && cd ${ACTIONS_CACHE_DIR} \ - && git clone --depth 1 --branch v4 https://github.com/actions/checkout.git actions-checkout@v4 \ - && git clone --depth 1 --branch v4 https://github.com/actions/cache.git actions-cache@v4 \ - && git clone --depth 1 --branch v4 https://github.com/actions/upload-artifact.git actions-upload-artifact@v4 \ - && git clone --depth 1 --branch v4 https://github.com/actions/download-artifact.git actions-download-artifact@v4 \ + # 目录结构必须是 {owner}/{repo}@{ref} 格式 + && mkdir -p ${ACTIONS_CACHE_DIR}/actions \ + && cd ${ACTIONS_CACHE_DIR}/actions \ + && git clone --depth 1 --branch v4 https://github.com/actions/checkout.git checkout@v4 \ + && git clone --depth 1 --branch v4 https://github.com/actions/cache.git cache@v4 \ + && git clone --depth 1 --branch v4 https://github.com/actions/upload-artifact.git upload-artifact@v4 \ + && git clone --depth 1 --branch v4 https://github.com/actions/download-artifact.git download-artifact@v4 \ # 清理 .git 目录减少镜像体积 && find ${ACTIONS_CACHE_DIR} -name ".git" -type d -exec rm -rf {} + 2>/dev/null || true