forked from nychealth/coronavirus-data
-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (33 loc) · 1.42 KB
/
mergeUpstream.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
36
37
38
39
40
name: Merge upstream branches
# https://stackoverflow.com/questions/23793062/can-forks-be-synced-automatically-in-github
# Alternative: https://github.com/settings/installations/24978774
# Manually trigger alternative:
# https://pull.git.ci/process/andybloch/coronavirus-data
on:
schedule:
#- cron: '*/15 * * * *'
jobs:
merge:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Merge upstream
run: |
git config --global user.name 'merge-upstream-branches'
git config --global user.email '[email protected]'
# "git checkout master" is unnecessary, already here by default
git pull --unshallow # this option is very important, you would get
# complains about unrelated histories without it.
# (but actions/checkout@v2 can also be instructed
# to fetch all git depth right from the start)
git remote add upstream https://github.com/nychealth/coronavirus-data.git
git fetch upstream
# Neither forget the -b opt,
# the feature/x ref is ambiguous at this stage
git checkout -b feature/x origin/feature/x
git merge --no-edit upstream/feature/x
git push origin feature/x
git checkout master
git merge --no-edit upstream/master
git push origin master
# etc