Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

ci(workflows): 钉死 cindy-protocol submodule 来源再拉取

Lizi1bed48d65b0a
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 052ffc94a3..7e21ddf16f 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -33,6 +33,23 @@ jobs:
fetch-depth: 0
lfs: true
+ # .gitmodules 来自 PR 分支,fork PR 可以把 cindy-protocol 的 url / path 改成
+ # 任意仓库。先钉死来源再 sync/update,避免 CI 拉取并 pnpm install 第三方仓库
+ # 内容。gitlink 的 commit 同样来自 PR,但只能从 makecindy/cindy-protocol 拉取,
+ # 外部无法向该仓库推送,所以来源钉死后取到的一定是本组织的历史。
+ - name: Verify cindy-protocol submodule source
+ run: |
+ set -euo pipefail
+ expected_url='https://github.com/makecindy/cindy-protocol.git'
+ expected_path='cindy-protocol'
+ actual_url="$(git config -f .gitmodules --get submodule.cindy-protocol.url || true)"
+ actual_path="$(git config -f .gitmodules --get submodule.cindy-protocol.path || true)"
+ if [ "$actual_url" != "$expected_url" ] || [ "$actual_path" != "$expected_path" ]; then
+ echo "::error file=.gitmodules::cindy-protocol submodule 来源不符: url='$actual_url' path='$actual_path'(期望 url='$expected_url' path='$expected_path')"
+ exit 1
+ fi
+ echo "cindy-protocol submodule 来源校验通过: $actual_url"
+
# 本 job 只做本仓 typecheck / 单测 / 各类 guard。cindy-protocol 是公开的
# workspace 依赖,需要 checkout 以供 pnpm install 解析,但不在本 job 运行
# 协议仓自己的 CI。