Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add automatic branch synchronization #5537

Merged
merged 30 commits into from
Nov 22, 2022
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
703dfbf
test sync
ygoumaz Nov 21, 2022
af60b11
minor fix
ygoumaz Nov 21, 2022
3fd792d
remove checkout
ygoumaz Nov 21, 2022
bde892e
restore branch
ygoumaz Nov 21, 2022
60de3af
Remove branch
ygoumaz Nov 21, 2022
83700cf
test
ygoumaz Nov 21, 2022
c7a1b22
test
ygoumaz Nov 21, 2022
0f84fba
test
ygoumaz Nov 21, 2022
5394021
origin
ygoumaz Nov 21, 2022
74cb160
test
ygoumaz Nov 21, 2022
a04ab0d
test double checkout
ygoumaz Nov 21, 2022
9877a99
checkout after
ygoumaz Nov 21, 2022
7065d04
fetch develop
ygoumaz Nov 21, 2022
8475e5c
test
ygoumaz Nov 21, 2022
62ab31c
test
ygoumaz Nov 21, 2022
68a260b
change depth
ygoumaz Nov 21, 2022
20f9851
Update title
ygoumaz Nov 21, 2022
cd2ccb3
Merge branch 'master' into test-sync
ygoumaz Nov 21, 2022
58208ef
Merge branch 'test-sync' of https://github.com/cyberbotics/webots int…
ygoumaz Nov 21, 2022
13d6c7e
Add released with master
ygoumaz Nov 21, 2022
1d5b23c
Merge branch 'master' into test-sync
ygoumaz Nov 21, 2022
c944e6b
Allow empty develop PR if released in master
ygoumaz Nov 21, 2022
d85b538
Merge branch 'test-sync' of https://github.com/cyberbotics/webots int…
ygoumaz Nov 21, 2022
63fce9a
Merge branch 'master' into test-sync
ygoumaz Nov 21, 2022
aab8d3d
Remove wrong tab
ygoumaz Nov 21, 2022
f1f61b4
launch test
ygoumaz Nov 21, 2022
2b1838b
remove test in pull request
ygoumaz Nov 21, 2022
1c3e214
Merge branch 'master' into add-automatic-branch-sync
ygoumaz Nov 21, 2022
131a2d5
Merge branch 'master' into add-automatic-branch-sync
omichel Nov 22, 2022
5174367
Update sync_develop_master.yml
ygoumaz Nov 22, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .github/workflows/sync_develop_master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Branch synchronizer

on:
schedule:
- cron: '0 04 * * *'

jobs:
sync-master-with-released:
runs-on: ubuntu-latest
steps:
- name: Checkout released
uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
ref: released
- name: Check for diff
id: check-diff
run: |
git fetch origin master
git checkout master
if [ -n "$(git diff master...released)" ]; then
echo "Master needs sync with released!";
echo "create_pull_request=1" >> $GITHUB_OUTPUT
else
echo "Master is already up to date.";
echo "create_pull_request=0" >> $GITHUB_OUTPUT
fi
- name: Create Pull Request if necessary
if: ${{ steps.check-diff.outputs.create_pull_request == 1 }}
uses: repo-sync/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
source_branch: released
destination_branch: master
pr_title: Merge released into master
pr_body: Synchronizes changes of released branch into master branch.
pr_reviewer: Maintainers
outputs:
pr_opened: ${{ steps.check-diff.outputs.create_pull_request == 1 }}
sync-develop-with-master:
runs-on: ubuntu-latest
needs: sync-master-with-released
steps:
- name: Checkout master
uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
ref: master
- name: Check for diff
id: check-diff
run: |
git fetch origin develop
git checkout develop
if [ -n "$(git diff develop...master)" ]; then
echo "Develop needs sync with master!";
echo "create_pull_request=1" >> $GITHUB_OUTPUT
else
echo "Develop is already up to date.";
echo "create_pull_request=0" >> $GITHUB_OUTPUT
fi
- name: Create Pull Request if necessary
if: ${{ steps.check-diff.outputs.create_pull_request == 1 }} || ${{ needs.sync-master-with-released.outputs.pr_opened == 1 }}
uses: repo-sync/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
source_branch: master
destination_branch: develop
pr_title: Merge master into develop
pr_body: Synchronizes changes of master branch into develop branch.
pr_reviewer: Maintainers
pr_allow_empty: true
ad-daniel marked this conversation as resolved.
Show resolved Hide resolved