-
Notifications
You must be signed in to change notification settings - Fork 4
40 lines (35 loc) · 1.28 KB
/
sync_with_oss.yaml
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: Sync with Open Source
on:
# Triggers the workflow on push or pull request events but only for the master branch
schedule:
- cron: '*/15 * * * *'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
with:
token: ${{ secrets.PAT }}
fetch-depth: 0
# Create publish workflow for every commit that is picked up
- name: Update mirror branch to match upstream master
run: |
git config --global user.email "[email protected]"
git config --global user.name "William Lo"
git checkout prod
CUR_HEAD=$(git rev-parse HEAD)
echo "Current head at ${CUR_HEAD}"
git remote add upstream https://github.com/apache/gobblin.git
git fetch upstream master
for commit in $(git rev-list $CUR_HEAD..upstream/master --reverse); do
echo $commit
git rebase $commit
git push origin prod
git checkout master
git cherry-pick $commit
git push origin master
git checkout prod
done