mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-19 06:43:34 +08:00
ci(ros): use matching branch for px4-ros2-interface-lib (#26781)
* ci(ros): use matching branch for px4-ros2-interface-lib When running on release branches, the ROS integration tests now check if a matching branch exists in px4-ros2-interface-lib and clone it instead of always using main. This prevents build failures caused by uORB message divergence between main and release branches. Fixes https://github.com/Auterion/px4-ros2-interface-lib/issues/184 Signed-off-by: Ramon Roche <mrpollo@gmail.com> * ci(ros): dispatch release branch creation to px4-ros2-interface-lib Add a standalone workflow triggered by the create event that fires a repository_dispatch to Auterion/px4-ros2-interface-lib when a release/X.Y branch is created. Also supports manual workflow_dispatch. Signed-off-by: Ramon Roche <mrpollo@gmail.com> * ci(ros): add empty permissions block to dispatch workflow Fixes code scanning alert about missing GITHUB_TOKEN permissions. This workflow only uses a PAT secret, not GITHUB_TOKEN, so no permissions are needed. Signed-off-by: Ramon Roche <mrpollo@gmail.com> --------- Signed-off-by: Ramon Roche <mrpollo@gmail.com>
This commit is contained in:
@@ -89,7 +89,15 @@ jobs:
|
||||
. /opt/ros/galactic/setup.bash
|
||||
mkdir -p /opt/px4_ws/src
|
||||
cd /opt/px4_ws/src
|
||||
git clone --recursive https://github.com/Auterion/px4-ros2-interface-lib.git
|
||||
BRANCH="${GITHUB_HEAD_REF:-$GITHUB_REF_NAME}"
|
||||
REPO_URL="https://github.com/Auterion/px4-ros2-interface-lib.git"
|
||||
if git ls-remote --heads "$REPO_URL" "$BRANCH" | grep -q "$BRANCH"; then
|
||||
echo "Cloning px4-ros2-interface-lib with matching branch: $BRANCH"
|
||||
git clone --recursive --branch "$BRANCH" "$REPO_URL"
|
||||
else
|
||||
echo "Branch '$BRANCH' not found in px4-ros2-interface-lib, using default (main)"
|
||||
git clone --recursive "$REPO_URL"
|
||||
fi
|
||||
# Ignore python packages due to compilation issue (can be enabled when updating ROS)
|
||||
touch px4-ros2-interface-lib/px4_ros2_py/COLCON_IGNORE || true
|
||||
touch px4-ros2-interface-lib/examples/python/COLCON_IGNORE || true
|
||||
|
||||
Reference in New Issue
Block a user