Skip to content

Sync to ChatGPT-Next-Web-Storage-2 #9

Sync to ChatGPT-Next-Web-Storage-2

Sync to ChatGPT-Next-Web-Storage-2 #9

Workflow file for this run

name: Sync to ChatGPT-Next-Web-Storage-2
# 允许手动触发工作流
on:
schedule:
- cron: '0 3 * * *' # 定时触发(例如,每天凌晨3点)
workflow_dispatch: # 手动触发
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Sync Echo
run: |
# echo ${{ secrets.PERSONAL_ACCESS_TOKEN }}
- name: Checkout source repository
uses: actions/checkout@v2
with:
repository: leetreeyoung/ChatGPT-Next-Web
token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout target repository
uses: actions/checkout@v2
with:
repository: leetreeyoung/ChatGPT-Next-Web-Storage-2
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
ref: main
path: target-repo
- name: Sync changes
run: |
rsync -a --delete --exclude='.git' . 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