forked from runhey/OnmyojiAutoScript
-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (32 loc) · 1018 Bytes
/
rebase-upstream-dev.yaml
File metadata and controls
38 lines (32 loc) · 1018 Bytes
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
36
37
38
name: Rebase dev onto Upstream
on:
push:
branches:
- dev
schedule:
- cron: '0 2,14 * * *' # 每天 2:00 和 14:00 UTC 自动执行
workflow_dispatch: # 支持手动触发
jobs:
rebase:
runs-on: ubuntu-latest
steps:
- name: Checkout dev branch
uses: actions/checkout@v4
with:
ref: dev
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0 # 必须完整历史才能 rebase
- name: Set up Git
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Add Upstream
run: |
git remote add upstream https://github.com/runhey/OnmyojiAutoScript.git
git fetch upstream dev
- name: Rebase onto Upstream/dev
run: |
git rebase upstream/dev || (git rebase --abort && exit 1)
- name: Push to Fork
run: |
git push origin dev --force-with-lease