fix: print errors in weblate merge job (#21683)

This commit is contained in:
bo0tzz 2025-09-08 17:37:10 +02:00 committed by GitHub
parent c0bff4b493
commit 6a55c36762
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -21,16 +21,23 @@ jobs:
env: env:
GH_TOKEN: ${{ github.token }} GH_TOKEN: ${{ github.token }}
run: | run: |
set -euo pipefail
gh pr list --repo $GITHUB_REPOSITORY --author weblate --json number,mergeable | read PR gh pr list --repo $GITHUB_REPOSITORY --author weblate --json number,mergeable | read PR
echo "$PR"
echo "$PR" | jq ' echo "$PR" | jq '
if length == 1 then if length == 1 then
.[0].number .[0].number
else else
error("Expected exactly 1 entry, got \(length)") error("Expected exactly 1 entry, got \(length)")
end end
' | read PR_NUMBER ' 2>&1 | read PR_NUMBER || exit 1
echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_OUTPUT 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 - name: Generate a token
id: generate_token id: generate_token