diff --git a/.github/workflows/check-weblate-prs.yml b/.github/workflows/check-weblate-prs.yml new file mode 100644 index 000000000..0f4800569 --- /dev/null +++ b/.github/workflows/check-weblate-prs.yml @@ -0,0 +1,33 @@ +name: Block EN Merges on Active Weblate PRs + +on: + pull_request: + paths: + - 'wiki/en/**' + +jobs: + check-weblate: + name: Evaluate Weblate PR Status + runs-on: ubuntu-24.04-arm + permissions: + pull-requests: read + + steps: + - name: Check for open Weblate pull requests + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + REPO: ${{ github.repository }} + run: | + WEBLATE_AUTHOR="weblate" + + echo "Checking $REPO for open PRs from $WEBLATE_AUTHOR..." + + OPEN_PRS=$(gh pr list --repo "$REPO" --state open --author "$WEBLATE_AUTHOR" --json number -q '. | length') + + if [ "$OPEN_PRS" -gt 0 ]; then + echo "::error::Found $OPEN_PRS open Weblate PR(s). Merging changes to English documentation is blocked to prevent po4a translation conflicts." + exit 1 + else + echo "No open Weblate PRs detected. Safe to proceed." + exit 0 + fi \ No newline at end of file