From 811fae62082a5a1cd1b83e253d006b99d40092a9 Mon Sep 17 00:00:00 2001 From: HibiKier <775757368@qq.com> Date: Fri, 13 Jun 2025 16:42:23 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E6=B7=BB=E5=8A=A0GitCode=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E5=B7=A5=E4=BD=9C=E6=B5=81=E5=92=8C=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E4=BB=93=E5=BA=93=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/sync-to-gitcode.yml | 20 +++++++++++++++++++ .../builtin_plugins/plugin_store/config.py | 3 +++ 2 files changed, 23 insertions(+) create mode 100644 .github/workflows/sync-to-gitcode.yml diff --git a/.github/workflows/sync-to-gitcode.yml b/.github/workflows/sync-to-gitcode.yml new file mode 100644 index 00000000..729f152b --- /dev/null +++ b/.github/workflows/sync-to-gitcode.yml @@ -0,0 +1,20 @@ +name: Sync to GitCode (Only on PR Merge to Main) +on: + pull_request: + types: [closed] # 监听 PR 关闭事件 + branches: [main] # 仅当目标分支是 main 时才触发 + +jobs: + sync: + if: github.event.pull_request.merged == true # 仅当 PR 被合并时运行 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: main # 检出 main 分支 + fetch-depth: 0 # 获取完整历史 + + - name: Push to GitCode + run: | + git remote add gitcode https://qq_41605780:${{ secrets.GITCODE_TOKEN }}@gitcode.com/qq_41605780/zhenxun_bot.git + git push gitcode HEAD:main --force-with-lease diff --git a/zhenxun/builtin_plugins/plugin_store/config.py b/zhenxun/builtin_plugins/plugin_store/config.py index dacaffec..e3b5d3d1 100644 --- a/zhenxun/builtin_plugins/plugin_store/config.py +++ b/zhenxun/builtin_plugins/plugin_store/config.py @@ -9,3 +9,6 @@ DEFAULT_GITHUB_URL = "https://github.com/zhenxun-org/zhenxun_bot_plugins/tree/ma EXTRA_GITHUB_URL = "https://github.com/zhenxun-org/zhenxun_bot_plugins_index/tree/index" """插件库索引github仓库地址""" + +DEFAULT_GITCODE_RAW_URL = "https://raw.gitcode.com/gh_mirrors/zh/zhenxun_bot/raw/main" +"""伴生插件gitcode仓库地址"""