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仓库地址"""