From 6a55c36762b07ad88e61004bb0121a06950167af Mon Sep 17 00:00:00 2001 From: bo0tzz Date: Mon, 8 Sep 2025 17:37:10 +0200 Subject: [PATCH] fix: print errors in weblate merge job (#21683) --- .github/workflows/merge-translations.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/merge-translations.yml b/.github/workflows/merge-translations.yml index 89a20290a9..c4167efa8a 100644 --- a/.github/workflows/merge-translations.yml +++ b/.github/workflows/merge-translations.yml @@ -21,16 +21,23 @@ jobs: env: GH_TOKEN: ${{ github.token }} run: | + set -euo pipefail + gh pr list --repo $GITHUB_REPOSITORY --author weblate --json number,mergeable | read PR + echo "$PR" + echo "$PR" | jq ' if length == 1 then .[0].number else error("Expected exactly 1 entry, got \(length)") end - ' | read PR_NUMBER + ' 2>&1 | read PR_NUMBER || exit 1 + echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_OUTPUT - echo "$PR" | jq -e '.[0].mergeable == "MERGEABLE"' || (echo "PR is not mergeable" && exit 1) + echo "Selected PR $PR_NUMBER" + + echo "$PR" | jq -e '.[0].mergeable == "MERGEABLE"' || { echo "PR is not mergeable" ; exit 1 } - name: Generate a token id: generate_token