From 37adb739cd3e94ad816672414dec65bcf52e37d0 Mon Sep 17 00:00:00 2001 From: longwangjiang <61648367+longwangjiang@users.noreply.github.com> Date: Thu, 4 Jul 2024 16:06:41 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=BA=E4=B8=B0=E9=80=9F=E8=BF=90=E7=AD=89py?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 顺丰速运等py脚本同步 --- .github/workflows/CHERWIN_SCRIPTS.yml | 47 +++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/CHERWIN_SCRIPTS.yml diff --git a/.github/workflows/CHERWIN_SCRIPTS.yml b/.github/workflows/CHERWIN_SCRIPTS.yml new file mode 100644 index 000000000..1af2f9d52 --- /dev/null +++ b/.github/workflows/CHERWIN_SCRIPTS.yml @@ -0,0 +1,47 @@ +name: CHERWIN_SCRIPTS +on: + schedule: + - cron: '9 19 * * *' + workflow_dispatch: + repository_dispatch: + types: sync-CHERWIN_SCRIPTS +jobs: + repo-sync: + env: + PAT: ${{ secrets.PAT }} + runs-on: ubuntu-latest + if: github.event.repository.owner.id == github.event.sender.id + steps: + - name: Checkout the repository + uses: actions/checkout@v2 + with: + persist-credentials: false + + - name: Check if branch exists + id: check_branch + run: | + if git show-ref --verify --quiet refs/heads/CHERWIN_SCRIPTS; then + echo "branch_exists=true" >> $GITHUB_ENV + else: + echo "branch_exists=false" >> $GITHUB_ENV + fi + + - name: Delete existing branch + if: ${{ env.branch_exists == 'true' }} + run: | + git push origin --delete CHERWIN_SCRIPTS + + - name: Create new branch + if: ${{ env.branch_exists == 'false' }} + run: | + git checkout -b CHERWIN_SCRIPTS + git push --set-upstream origin CHERWIN_SCRIPTS + + - name: Sync branch + uses: repo-sync/github-sync@v2 + if: env.PAT + with: + source_repo: "https://github.com/CHERWING/CHERWIN_SCRIPTS" + source_branch: "main" + destination_branch: "CHERWIN_SCRIPTS" + github_token: ${{ secrets.PAT }}