diff --git a/.github/workflows/sync-to-gitee.yml b/.github/workflows/sync-to-gitee.yml new file mode 100644 index 00000000..6ec3416d --- /dev/null +++ b/.github/workflows/sync-to-gitee.yml @@ -0,0 +1,27 @@ +name: Sync to Gitee +run-name: "[${{ github.workflow }}] - ${{ github.event.head_commit.message }}" + +on: + push: + branches: + - main + +concurrency: + group: ${{ github.workflow}} + cancel-in-progress: true + +env: + GITEE_REPOSITORY: zaonline/devpilot-intellij +jobs: + sync_to_gitee: + runs-on: ubuntu-latest + if: github.repository == 'openpilot-hub/devpilot-intellij' + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - run: | + remote_repo="https://${{ secrets.GITEE_USERNAME }}:${{ secrets.GITEE_PAT }}@gitee.com/${{ env.GITEE_REPOSITORY }}.git" + git remote add gitee "${remote_repo}" + branch=$(git branch --show-current) + git push gitee $branch -f \ No newline at end of file