Skip to content

Commit

Permalink
顺丰速运等py脚本同步
Browse files Browse the repository at this point in the history
顺丰速运等py脚本同步
  • Loading branch information
longwangjiang authored Jul 4, 2024
1 parent 5d03f08 commit 37adb73
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/CHERWIN_SCRIPTS.yml
Original file line number Diff line number Diff line change
@@ -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 }}

0 comments on commit 37adb73

Please sign in to comment.