forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (29 loc) · 878 Bytes
/
sync.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Sync Fork
on:
schedule:
- cron: '0 0 * * *' # 每天 UTC 时间午夜运行一次
workflow_dispatch: # 允许手动触发
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout downstream repository
uses: actions/checkout@v3
with:
repository: offsoc/linux
token: ${{ secrets.TOKEN }}
- name: Setup Git
run: |
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
- name: Add upstream repository
run: |
git remote add upstream https://github.com/torvalds/linux.git
git fetch upstream
git checkout master
git merge upstream/master
- name: Push changes
run: |
git push origin master
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}