Merge upstream/main into feat/dws-devapp
Sync with DingTalk-Real-AI/main (1.0.35–1.0.40): - 1.0.35–1.0.39: chat @-mentions, sheet export, doc strip unsafe chars, PAT batch grants, devdoc RAG, agent_code detection, AI-tag opt-in - 1.0.40 (#486): China mirror via Gitee + npmmirror - (#488) embed skills/ into binary - (#464) strip duplicate H1 on JSONML doc-create # Conflicts: # .github/workflows/release.yml # CHANGELOG.md # README.md # README_zh.md # docs/command-index.md # internal/app/runner.go # internal/app/runner_test.go # internal/auth/channel.go # internal/helpers/devdoc.go # internal/helpers/devdoc_test.go # internal/pat/chmod.go # internal/pat/chmod_test.go # internal/pat/pat.go # internal/transport/client.go # scripts/install-skills.sh # scripts/install.ps1 # scripts/install.sh # skills/mono/references/products/devdoc.md # skills/mono/references/products/simple.md # skills/multi/dingtalk-devdoc/references/devdoc.md # skills/multi/dingtalk-skill/references/skill.md # test/cli_compat/devdoc_test.go # test/cli_compat/helpers_test.go # test/skill_tests.md # test/skill_tests_results.md # test/unit/pat_host_owned_signal_test.go
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
# 此 workflow 把本仓库代码自动镜像到 Gitee,供国内用户访问。
|
||||
# 需要在仓库 Settings → Secrets and variables → Actions 配置两个 secret:
|
||||
# GITEE_TOKEN —— Gitee 私人令牌(在 Gitee 设置→私人令牌生成),需勾选 projects + admin:repo_hook 权限。
|
||||
# GITEE_PRIVATE_KEY —— SSH 私钥(本地 ssh-keygen 生成的私钥),对应公钥需添加到 Gitee 账号的 SSH 公钥中。
|
||||
# 未配置 secret 时(例如 fork 仓库),mirror step 会被自动跳过,不会报错(不会出现红叉)。
|
||||
name: Mirror code to Gitee
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
tags:
|
||||
- 'v*'
|
||||
schedule:
|
||||
- cron: '0 18 * * *'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
mirror:
|
||||
runs-on: ubuntu-latest
|
||||
# GitHub Actions 不允许在 job-level if 直接引用 secrets,因此先用 env 暴露 secret,
|
||||
# 再在 step 里做守卫判断。hub-mirror 必须有 SSH 私钥(GITEE_PRIVATE_KEY)才能推送,
|
||||
# 故以它为守卫:未配置时整步跳过(代码镜像可改由 Gitee 侧 pull-mirror 承担),不报红叉。
|
||||
env:
|
||||
GITEE_TOKEN: ${{ secrets.GITEE_TOKEN }}
|
||||
GITEE_PRIVATE_KEY: ${{ secrets.GITEE_PRIVATE_KEY }}
|
||||
steps:
|
||||
- name: Mirror to Gitee
|
||||
if: env.GITEE_PRIVATE_KEY != ''
|
||||
uses: Yikun/hub-mirror-action@master
|
||||
with:
|
||||
src: "github/DingTalk-Real-AI"
|
||||
dst: "gitee/DingTalk-Real-AI"
|
||||
dst_key: ${{ secrets.GITEE_PRIVATE_KEY }}
|
||||
dst_token: ${{ secrets.GITEE_TOKEN }}
|
||||
account_type: "org"
|
||||
static_list: "dingtalk-workspace-cli"
|
||||
clone_style: "https"
|
||||
force_update: true
|
||||
@@ -70,6 +70,16 @@ jobs:
|
||||
OSS_BUCKET: ${{ secrets.OSS_BUCKET }}
|
||||
OSS_PREFIX: ${{ secrets.OSS_PREFIX }}
|
||||
|
||||
- name: Mirror release to Gitee (China)
|
||||
# 把 release 附件(二进制/校验和/skills 包)镜像到 Gitee release,供 install.sh
|
||||
# 的 DWS_GITEE_REPO 开关消费(仓库代码由 Gitee 仓库镜像功能自动同步,附件不在其内)。
|
||||
# 脚本自带门控:未配置 GITEE_TOKEN / GITEE_REPO 时优雅跳过,不影响海外发布。
|
||||
run: ./scripts/release/sync-to-gitee.sh
|
||||
env:
|
||||
VERSION: ${{ github.ref_name }}
|
||||
GITEE_TOKEN: ${{ secrets.GITEE_TOKEN }}
|
||||
GITEE_REPO: ${{ secrets.GITEE_REPO }}
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
|
||||
Reference in New Issue
Block a user