forked from ton-blockchain/ton
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added github workflow to sync with upstream
- Loading branch information
1 parent
5c392e0
commit cc2637e
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 |