From 760f99baeb2b5d69394d93aa8a184badba47b42b Mon Sep 17 00:00:00 2001 From: Xuefei Li Date: Wed, 21 Jan 2026 15:45:14 +0800 Subject: [PATCH] Add workflow to sync develop branch to test-release --- .../sync-develop-to-test-release.yml | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/sync-develop-to-test-release.yml diff --git a/.github/workflows/sync-develop-to-test-release.yml b/.github/workflows/sync-develop-to-test-release.yml new file mode 100644 index 0000000..ec43fa6 --- /dev/null +++ b/.github/workflows/sync-develop-to-test-release.yml @@ -0,0 +1,33 @@ +name: Sync develop to test-release + +on: + push: + branches: + - develop + +jobs: + sync: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Sync test-release to develop + env: + GITHUB_ACTOR: ${{ github.actor }} + run: | + git config user.name "$GITHUB_ACTOR" + git config user.email "$GITHUB_ACTOR@users.noreply.github.com" + + # 拉取最新的 develop 和 test-release + git fetch origin develop test-release + + # 基于最新 develop 创建/重置本地临时分支 + git checkout -B sync-temp origin/develop + + # 强制将远端 test-release 覆盖为 develop 当前状态 + git push origin +sync-temp:test-release