From 3332d2288fb00cbed7b3380911835592b7bfbd10 Mon Sep 17 00:00:00 2001 From: xiaojunnuo Date: Wed, 18 Mar 2026 16:16:22 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=94=AF=E6=8C=81=E6=8E=A8=E9=80=81?= =?UTF-8?q?=E5=88=B0cnb?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/sync-to-cnb-dev.yml | 34 +++++++++++++++++++++++++++ .github/workflows/sync-to-cnb.yml | 34 +++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 .github/workflows/sync-to-cnb-dev.yml create mode 100644 .github/workflows/sync-to-cnb.yml diff --git a/.github/workflows/sync-to-cnb-dev.yml b/.github/workflows/sync-to-cnb-dev.yml new file mode 100644 index 000000000..f59c55b21 --- /dev/null +++ b/.github/workflows/sync-to-cnb-dev.yml @@ -0,0 +1,34 @@ +name: sync-to-cnb-dev +on: + push: + branches: ['v2-dev'] +# schedule: +# - # 国际时间 19:17 执行,北京时间3:17 ↙↙↙ 改成你想要每天自动执行的时间 +# - cron: '17 19 * * *' +permissions: + contents: read + +jobs: + sync: + runs-on: ubuntu-latest + steps: + - name: Checkout work repo # 1. 检出当前仓库(certd-sync-work) + uses: actions/checkout@v4 + with: + fetch-depth: 0 + lfs: true + - name: Set git user # 2. 给git命令设置用户名和邮箱,↙↙↙ 改成你的name和email + run: | + git config --global user.name "xiaojunnuo" + git config --global user.email "xiaojunnuo@qq.com" + + - name: Set git token # 3. 给git命令设置token,用于push到目标仓库 + uses: de-vri-es/setup-git-credentials@v2 + with: # token 格式为: username:password + credentials: https://cnb:${{secrets.TOKEN_CNB}}@cnb.cool + + - name: push to cnb # 4. 执行同步 + run: | + git remote add upstream https://cnb.cool/certd/certd + git push --set-upstream upstream v2-dev + diff --git a/.github/workflows/sync-to-cnb.yml b/.github/workflows/sync-to-cnb.yml new file mode 100644 index 000000000..023da28e6 --- /dev/null +++ b/.github/workflows/sync-to-cnb.yml @@ -0,0 +1,34 @@ +name: sync-to-cnb +on: + push: + branches: ['v2'] +# schedule: +# - # 国际时间 19:17 执行,北京时间3:17 ↙↙↙ 改成你想要每天自动执行的时间 +# - cron: '17 19 * * *' +permissions: + contents: read + +jobs: + sync: + runs-on: ubuntu-latest + steps: + - name: Checkout work repo # 1. 检出当前仓库(certd-sync-work) + uses: actions/checkout@v4 + with: + fetch-depth: 0 + lfs: true + - name: Set git user # 2. 给git命令设置用户名和邮箱,↙↙↙ 改成你的name和email + run: | + git config --global user.name "xiaojunnuo" + git config --global user.email "xiaojunnuo@qq.com" + + - name: Set git token # 3. 给git命令设置token,用于push到目标仓库 + uses: de-vri-es/setup-git-credentials@v2 + with: # token 格式为: username:password + credentials: https://cnb:${{secrets.TOKEN_CNB}}@cnb.cool + + - name: push to cnb # 4. 执行同步 + run: | + git remote add upstream https://cnb.cool/certd/certd + git push --set-upstream upstream v2 +