From 5191f7ab5390d72bb9e22ac982fe4d47ccbbe880 Mon Sep 17 00:00:00 2001 From: "Radjammin@gmail.com" Date: Sun, 26 Jul 2026 18:10:00 -0400 Subject: [PATCH 1/3] Add workflow to block EN docs if Weblate PR is open --- .github/workflows/check-weblate-prs.yml | 40 +++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/check-weblate-prs.yml diff --git a/.github/workflows/check-weblate-prs.yml b/.github/workflows/check-weblate-prs.yml new file mode 100644 index 000000000..73dc41471 --- /dev/null +++ b/.github/workflows/check-weblate-prs.yml @@ -0,0 +1,40 @@ +name: Block EN Merges on Active Weblate PRs + +on: + pull_request: + # Triggers the check only when source documentation is modified. + # Adjust these paths based on where the English source files live in the repo. + paths: + - '**/*.md' + - '_pages/**' + - '_posts/**' + +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="app/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 \ No newline at end of file From 447931fc91bcbaaefa9875a6ea2818d1fc2d17f8 Mon Sep 17 00:00:00 2001 From: "Radjammin@gmail.com" Date: Sun, 26 Jul 2026 18:24:38 -0400 Subject: [PATCH 2/3] fix: update Weblate bot author username to 'weblate' --- .github/workflows/check-weblate-prs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-weblate-prs.yml b/.github/workflows/check-weblate-prs.yml index 73dc41471..abeaac4bd 100644 --- a/.github/workflows/check-weblate-prs.yml +++ b/.github/workflows/check-weblate-prs.yml @@ -24,7 +24,7 @@ jobs: 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="app/weblate" + WEBLATE_AUTHOR="weblate" echo "Checking $REPO for open PRs from $WEBLATE_AUTHOR..." From d092c977940dd7a13e7b191d56fcf4dd5e211487 Mon Sep 17 00:00:00 2001 From: "Radjammin@gmail.com" Date: Fri, 31 Jul 2026 20:21:55 -0400 Subject: [PATCH 3/3] updated per request --- .github/workflows/check-weblate-prs.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/check-weblate-prs.yml b/.github/workflows/check-weblate-prs.yml index abeaac4bd..60261ab0b 100644 --- a/.github/workflows/check-weblate-prs.yml +++ b/.github/workflows/check-weblate-prs.yml @@ -2,12 +2,8 @@ name: Block EN Merges on Active Weblate PRs on: pull_request: - # Triggers the check only when source documentation is modified. - # Adjust these paths based on where the English source files live in the repo. paths: - - '**/*.md' - - '_pages/**' - - '_posts/**' + - 'wiki/en/**' jobs: check-weblate: