Sync Fork #4
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 Fork | |
on: | |
schedule: | |
# 每天同步一次,你可以根据需要调整cron表达式 | |
- cron: '0 0 * * *' | |
workflow_dispatch: # 允许手动触发 | |
jobs: | |
sync: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
ref: main | |
- name: Setup git user | |
run: | | |
git config --global user.name 'GitHub Actions' | |
git config --global user.email '[email protected]' | |
- name: Fetch upstream | |
run: | | |
# 替换下面的URL为你想要同步的仓库的URL | |
git remote add upstream https://github.com/amclubs/am-cf-linklet.git | |
git fetch upstream | |
- name: Rebase | |
run: | | |
git rebase upstream/master | |
- name: Push to main | |
uses: easingthemes/[email protected] | |
with: | |
branch: main | |
force: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |