Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Auto Sync Fork

Auto Sync Fork #112

name: Auto Sync Fork
on:
schedule:
- cron: '0 0 * * *' # 每天 00:00 UTC 自动运行
workflow_dispatch: # 支持手动触发
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout target repo
uses: actions/checkout@v3
with:
persist-credentials: false
- name: Set git config
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
- name: Add upstream and fetch
run: |
git remote add upstream https://github.com/alantang1977/X.git
git fetch upstream
git checkout main
git merge upstream/main || true
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}