Fix use secrets gitee token (#17297)

### Summary

1. use  secrets gitee token
2. add gitee token to dockerfile
3. modify  pull_request  to pull_request_target
This commit is contained in:
maoyifeng
2026-07-23 19:34:02 +08:00
committed by GitHub
parent c3e03f5c06
commit b5e1b5dfd5
2 changed files with 37 additions and 14 deletions

View File

@@ -50,9 +50,15 @@ RUN --mount=type=cache,id=ragflow_apt,target=/var/cache/apt,sharing=locked \
fonts-freefont-ttf fonts-noto-cjk postgresql-client
# Download resource from GitHub to /usr/share/infinity
RUN mkdir -p /usr/share/infinity/resource && \
RUN --mount=type=secret,id=gitee_token \
mkdir -p /usr/share/infinity/resource && \
if [ "$NEED_MIRROR" == "1" ]; then \
git clone --depth 1 --single-branch https://gitee.com/infiniflow/resource /tmp/resource; \
GITEE_TOKEN=$(cat /run/secrets/gitee_token 2>/dev/null || echo ""); \
if [ -n "$GITEE_TOKEN" ]; then \
git clone --depth 1 --single-branch "https://oauth2:${GITEE_TOKEN}@gitee.com/infiniflow/resource" /tmp/resource; \
else \
git clone --depth 1 --single-branch https://github.com/infiniflow/resource.git /tmp/resource; \
fi; \
else \
git clone --depth 1 --single-branch https://github.com/infiniflow/resource.git /tmp/resource; \
fi && \