-
-
Notifications
You must be signed in to change notification settings - Fork 153
49 lines (47 loc) · 1.75 KB
/
libcontroller_updater.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
43
44
45
46
47
48
49
name: Libcontroller Updater
on:
schedule:
- cron: '0 04 * * *'
jobs:
automatic-libcontroller-sync:
strategy:
matrix:
include:
- webots_ros2_branch: master
- webots_ros2_branch: develop
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v3
with:
submodules: "true"
fetch-depth: 0
ref: ${{ matrix.webots_ros2_branch }}
- name: Copy Webots libController files
run: scripts/sync_controller_lib.sh ${{ matrix.webots_ros2_branch }}
- name: Create commit if necessary
id: create-commit
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "Submodule needs sync!";
git config --global user.name ${GITHUB_ACTOR}
git config --global user.email ${GITHUB_ACTOR}@github.com
git checkout -b ${{ env.BRANCH_NAME }}
git add .
git commit -m "Sync submodule"
git push origin ${{ env.BRANCH_NAME }}
echo "create_pull_request=1" >> $GITHUB_OUTPUT
else
echo "Submodule is already up to date.";
echo "create_pull_request=0" >> $GITHUB_OUTPUT
fi
- name: Create Pull Request
if: ${{ steps.create-commit.outputs.create_pull_request == 1 }}
uses: repo-sync/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
source_branch: ${{ env.BRANCH_NAME }}
destination_branch: ${{ matrix.webots_ros2_branch }}
pr_title: Sync libcontroller ${{ matrix.webots_ros2_branch }}
pr_body: Synchronizes libcontroller to the latest commit of branch ${{ matrix.webots_ros2_branch }}.
pr_reviewer: Maintainers