From f94f879184b628d72f581068beedc97fdb5ca846 Mon Sep 17 00:00:00 2001 From: Michael Fritsche <64464652+Frigiii@users.noreply.github.com> Date: Fri, 30 Oct 2026 11:39:07 +0100 Subject: [PATCH] ci(px4_msgs): fail the sync when the push to px4_msgs fails (#29520) Signed-off-by: Michael Fritsche --- .github/workflows/sync_to_px4_msgs.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sync_to_px4_msgs.yml b/.github/workflows/sync_to_px4_msgs.yml index 56966ff0e31..033a97e4173 100644 --- a/.github/workflows/sync_to_px4_msgs.yml +++ b/.github/workflows/sync_to_px4_msgs.yml @@ -52,11 +52,21 @@ jobs: cp srv/versioned/*.srv px4_msgs/srv/ || true - name: Commit and push changes + shell: bash + env: + # fail on a rejected token instead of prompting for a username + GIT_TERMINAL_PROMPT: 0 run: | + set -euo pipefail cd px4_msgs git status git add . - git commit -a -m "Update to PX4 ${{ github.sha }}" || true - git push origin ${{ github.ref_name }} || true + if git diff --cached --quiet; then + echo "No message changes to commit" + else + git commit -m "Update to PX4 ${{ github.sha }}" + fi + # push even without a new commit, so a bad token or a new branch never goes unnoticed + git push origin ${{ github.ref_name }} cd .. rm -rf px4_msgs