Sync to ChatGPT-Next-Web-AS-2 #156
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Sync to ChatGPT-Next-Web-AS-2 | |
# 允许手动触发工作流 | |
on: | |
schedule: | |
- cron: '0 0 * * *' # 定时触发(例如,每天凌晨3点) | |
workflow_dispatch: # 手动触发 | |
jobs: | |
sync: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source repository | |
uses: actions/checkout@v2 | |
with: | |
repository: leetreeyoung/ChatGPT-Next-Web | |
token: ${{ secrets.GITHUB_TOKEN }} | |
fetch-depth: 1 | |
path: source-repo | |
- name: Checkout target repository | |
uses: actions/checkout@v2 | |
with: | |
repository: leetreeyoung/ChatGPT-Next-Web-AS-2 | |
token: ${{secrets.TOKEN }} | |
ref: main | |
path: target-repo | |
fetch-depth: 1 | |
- name: Sync changes | |
run: | | |
rsync -av --delete --exclude='.git' source-repo/ target-repo/ | |
cd target-repo | |
git config --global user.email "[email protected]" | |
git config --global user.name "leetreeyoung" | |
git add . | |
git commit -m "Sync changes from ChatGPT-Next-Web" || echo "No changes to commit" | |
git push origin main |