File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # .github/workflows/example.yml
2+
3+ name : Merge upstream branches
4+ on :
5+ schedule :
6+ # actually, ~5 minutes is the highest
7+ # effective frequency you will get
8+ - cron : ' * * * * *'
9+ jobs :
10+ merge :
11+ runs-on : ubuntu-latest
12+ steps :
13+ - uses : actions/checkout@v2
14+ - name : Merge upstream
15+ run : |
16+ git config --global user.name 'your-name'
17+ git config --global user.email 'your-username@users.noreply.github.com'
18+
19+ # "git checkout master" is unnecessary, already here by default
20+ git pull --unshallow # this option is very important, you would get
21+ # complains about unrelated histories without it.
22+ # (but actions/checkout@v2 can also be instructed
23+ # to fetch all git depth right from the start)
24+
25+ git remote add upstream https://github.com/example/test.git
26+ git fetch upstream
27+
28+ # Neither forget the -b opt,
29+ # the feature/x ref is ambiguous at this stage
30+ git checkout -b feature/x origin/feature/x
31+ git merge --no-edit upstream/feature/x
32+ git push origin feature/x
33+
34+ git checkout master
35+ git merge --no-edit upstream/master
36+ git push origin master
37+
38+ # etc
You can’t perform that action at this time.
0 commit comments