Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/check-weblate-prs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
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-latest
permissions:
pull-requests: read

steps:
- name: Check for open Weblate pull requests
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
run: |
# The exact username of the Weblate bot (e.g., 'weblate', 'app/weblate')
# You may need to check a previous Weblate PR to confirm the exact author name.
WEBLATE_AUTHOR="weblate"

echo "Checking $REPO for open PRs from $WEBLATE_AUTHOR..."

# Query GitHub API for open PRs from the bot, output as JSON, and count the array length
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