forked from ton-blockchain/ton
-
Notifications
You must be signed in to change notification settings - Fork 7
42 lines (34 loc) · 1.16 KB
/
sync.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
41
42
name: Sync Fork
on:
schedule:
- cron: '0 * * * *' # Runs every hour
workflow_dispatch:
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Setup Git
run: |
git config --global user.name 'dbaranovstonfi'
git config --global user.email '[email protected]'
- name: Fetch all branches
run: git fetch --all
- name: Add remote upstream
run: git remote add upstream https://github.com/ton-blockchain/ton
- name: Fetch upstream branches
run: git fetch upstream
- name: Sync branches
run: |
for branch in $(git branch -r | grep upstream | grep -v '\->' | sed 's|upstream/||'); do
git checkout $branch || git checkout -b $branch
git merge upstream/$branch --allow-unrelated-histories
done
- name: Push changes
env:
PAT: ${{ secrets.PAT }}
run: |
for branch in $(git branch -r | grep upstream | grep -v '\->' | sed 's|upstream/||'); do
git push https://dbaranovstonfi:${PAT}@github.com/ston-fi/ton.git $branch
done