forked from ros2/rmw_fastrtps
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add workflow to rebase all desired branches (#11)
* Refs #13950: add workflow to rebase all desired branches Signed-off-by: JLBuenoLopez-eProsima <[email protected]> * Added Humble-related modifications Signed-off-by: Javier Santiago <[email protected]> Signed-off-by: JLBuenoLopez-eProsima <[email protected]> Signed-off-by: Javier Santiago <[email protected]> Co-authored-by: Javier Santiago <[email protected]>
- Loading branch information
1 parent
6e95aa9
commit d198a76
Showing
1 changed file
with
45 additions
and
10 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 |
---|---|---|
|
@@ -5,30 +5,65 @@ on: | |
- cron: '0 0 * * *' | ||
# scheduled every midnight | ||
workflow_dispatch: | ||
# manual run of the workflow job | ||
#manual run of the workflow job | ||
|
||
jobs: | ||
rebase-current-branch: | ||
rebase-branches: | ||
name: Rebase HEAD with upstream current branch | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
dest_branch: ['master', 'galactic', 'humble', 'vulcanexus', 'vulcanexus-galactic', 'vulcanexus-humble'] | ||
|
||
steps: | ||
# Step 1: run a standard checkout action, provided by github (REQUIRED) | ||
- name: Checkout target repo | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ matrix.dest_branch }} | ||
fetch-depth: 0 | ||
|
||
# Step 2: rebase action (REQUIRED) | ||
- name: Rebase current branch to upstream changes | ||
id: rebase | ||
# Step 2: Set git config and add remote (REQUIRED) | ||
- name: Set git config and add remote | ||
id: config | ||
run: | | ||
git remote add ros https://github.com/ros2/rmw_fastrtps.git | ||
git fetch ros ${GITHUB_REF##*/} | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "richiprosima" | ||
git rebase ros/${GITHUB_REF##*/} | ||
if [ "$(git status | grep diverged)" ]; then | ||
git remote add ros https://github.com/ros2/rmw_fastrtps.git | ||
shell: bash | ||
|
||
# Step 3: Rebase | ||
- name: Rebase current branch to upstream changes | ||
id: rebase_master_galactic | ||
run: | | ||
git fetch ros ${{ matrix.dest_branch }} | ||
git rebase ros/${{ matrix.dest_branch }} | ||
shell: bash | ||
if: matrix.dest_branch == 'master' || matrix.dest_branch == 'galactic' || matrix.dest_branch == 'humble' | ||
- id: rebase_vulcanexus | ||
run: | | ||
git fetch ros master | ||
git rebase ros/master | ||
shell: bash | ||
if: matrix.dest_branch == 'vulcanexus' | ||
- id: rebase_vulcanexus_galactic | ||
run: | | ||
git fetch ros galactic | ||
git rebase ros/galactic | ||
shell: bash | ||
if: matrix.dest_branch == 'vulcanexus-galactic' | ||
- id: rebase_vulcanexus_humble | ||
run: | | ||
git fetch ros humble | ||
git rebase ros/humble | ||
shell: bash | ||
if: matrix.dest_branch == 'vulcanexus-humble' | ||
|
||
# Step 4: Push | ||
- name: Force push if required | ||
id: push | ||
run: | | ||
if [ "$(git status | grep 'diverged\|ahead')" ]; then | ||
git push -f | ||
fi; | ||
shell: bash |