diff --git a/.github/workflows/sync-to-cnb.yml b/.github/workflows/sync-to-cnb.yml index 7bb7de16b..a6cdb90f1 100644 --- a/.github/workflows/sync-to-cnb.yml +++ b/.github/workflows/sync-to-cnb.yml @@ -4,32 +4,10 @@ on: - delete jobs: - sync-push: - if: ${{ github.repository == 'TDesignOteam/tdesign-api' && github.event_name == 'push' }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - fetch-depth: 0 - - - name: Sync to CNB Repository - run: | - docker run --rm \ - -v ${{ github.workspace }}:${{ github.workspace }} \ - -w ${{ github.workspace }} \ - -e PLUGIN_TARGET_URL="https://cnb.cool/tencent/tdesign/tdesign-api.git" \ - -e PLUGIN_AUTH_TYPE="https" \ - -e PLUGIN_USERNAME="cnb" \ - -e PLUGIN_PASSWORD=${{ secrets.CNB_TOKEN }} \ - -e PLUGIN_FORCE="true" \ - tencentcom/git-sync - - sync-delete-branch: - if: ${{ github.repository == 'TDesignOteam/tdesign-api' && github.event_name == 'delete' && github.event.ref_type == 'branch' }} - runs-on: ubuntu-latest - steps: - - uses: TDesignOteam/workflows/actions/cnb-delete-branch@86860a363fd94437a642fc968ca220efaa1babfe # main - with: - repo: "tencent/tdesign/tdesign-api" - token: ${{ secrets.CNB_TOKEN }} - branch: ${{ github.event.ref }} + call-cnb-sync: + uses: TDesignOteam/workflows/.github/workflows/reusable-cnb-sync.yml@main + with: + github-repo: TDesignOteam/tdesign-api + cnb-repo: tencent/tdesign/tdesign-api + secrets: + CNB_TOKEN: ${{ secrets.CNB_TOKEN }}