File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Sync upstream
2+
3+ on :
4+ schedule :
5+ - cron : ' 0 2 * * *' # 每天凌晨2点自动运行
6+ workflow_dispatch : # 支持手动触发
7+
8+ jobs :
9+ sync :
10+ runs-on : ubuntu-latest
11+ permissions :
12+ contents : write
13+ steps :
14+ - name : Checkout up-sync branch
15+ uses : actions/checkout@v4
16+ with :
17+ token : ${{ secrets.GITHUB_TOKEN }}
18+ fetch-depth : 0
19+ ref : up-sync
20+
21+ - name : Add upstream remote
22+ run : git remote add upstream https://github.com/ddnet/ddnet-maps
23+
24+ - name : Fetch upstream
25+ run : git fetch upstream
26+
27+ - name : Hard reset up-sync to upstream/master
28+ run : |
29+ git reset --hard upstream/master
30+
31+ - name : Push to origin up-sync branch (force)
32+ run : |
33+ git push origin up-sync --force
34+ env :
35+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments