Skip to content

Commit cf91ebd

Browse files
committed
Create scheduled github action to merge up stream branch
1 parent 97dc115 commit cf91ebd

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Merge upstream branches every Thursday 00:00
2+
on:
3+
schedule:
4+
- cron: '0 */12 * * *'
5+
jobs:
6+
merge:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
with:
11+
persist-credentials: false
12+
token: ${{secrets.GHPAGE_SECRET}}
13+
- name: Merge upstream
14+
run: |
15+
git config --global user.name 'GitHub Action by Anthony'
16+
git config --global user.email '[email protected]'
17+
18+
# "git checkout master" is unnecessary, already here by default
19+
git pull --unshallow # this option is very important, you would get
20+
# complains about unrelated histories without it.
21+
# (but actions/checkout@v2 can also be instructed
22+
# to fetch all git depth right from the start)
23+
24+
git remote set-url origin https://${{secrets.GHPAGE_SECRET}}@github.com/anthonychwong/gbgwcalculator
25+
26+
git remote add upstream https://github.com/rmkane/gbgwcalculator.github.io.git
27+
git fetch upstream
28+
29+
git checkout master
30+
git merge --no-edit upstream/master
31+
git push origin master

0 commit comments

Comments
 (0)