From a20dff9eb15bc581cc819b04fb51955044d3f429 Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Thu, 5 Mar 2026 02:08:45 +0100 Subject: [PATCH 1/3] feat: Add action to protect a page across all wikis --- scripts/protect_page_across_wikis.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 scripts/protect_page_across_wikis.py diff --git a/scripts/protect_page_across_wikis.py b/scripts/protect_page_across_wikis.py new file mode 100644 index 00000000000..43a49d42c32 --- /dev/null +++ b/scripts/protect_page_across_wikis.py @@ -0,0 +1,25 @@ +import os + +from deploy_util import get_wikis +from protect_page import ( + protect_non_existing_page, + protect_existing_page, + handle_protect_errors, +) + +PAGE_TO_PROTECT = os.getenv("PAGE_TO_PROTECT") + + +def main(): + for wiki in get_wikis(): + print(f"::group::Checking {wiki}:{PAGE_TO_PROTECT}") + if wiki == "commons": + protect_existing_page(PAGE_TO_PROTECT, wiki) + else: + protect_non_existing_page(PAGE_TO_PROTECT, wiki) + print("::endgroup::") + handle_protect_errors() + + +if __name__ == "__main__": + main() From 9c6b02e63c99b7320fb0a349c16b5a85b66ac796 Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Thu, 5 Mar 2026 02:12:35 +0100 Subject: [PATCH 2/3] Create protect page across wikis.yml --- .../workflows/protect page across wikis.yml | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/protect page across wikis.yml diff --git a/.github/workflows/protect page across wikis.yml b/.github/workflows/protect page across wikis.yml new file mode 100644 index 00000000000..bd269021365 --- /dev/null +++ b/.github/workflows/protect page across wikis.yml @@ -0,0 +1,35 @@ +name: Protect page across wikis + +on: + workflow_dispatch: + inputs: + page: + description: 'Page to protect (prefix with namespace and use underscores!)' + required: true + +jobs: + protect: + if: github.ref_name == github.event.repository.default_branch + name: Protect a given page across all wikis + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v6 + + - name: Setup Python + uses: actions/setup-python@v6 + with: + python-version: '3.14' + + - name: Install Python Dependency + run: pip install requests + + - name: Page Protect + env: + WIKI_USER: ${{ secrets.LP_BOTUSER }} + WIKI_PASSWORD: ${{ secrets.LP_BOTPASSWORD }} + WIKI_UA_EMAIL: ${{ secrets.LP_UA_EMAIL }} + WIKI_BASE_URL: ${{ secrets.LP_BASE_URL }} + PAGE_TO_PROTECT: ${{ github.event.inputs.page }} + PYTHONUNBUFFERED: 1 + run: python3 ./scripts/protect_page_across_wikis.py From bd8c659ffe071102a454fd7db859d4e2285f4d64 Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Thu, 5 Mar 2026 02:38:21 +0100 Subject: [PATCH 3/3] Update protect page across wikis.yml --- .github/workflows/protect page across wikis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/protect page across wikis.yml b/.github/workflows/protect page across wikis.yml index bd269021365..6f9674247e8 100644 --- a/.github/workflows/protect page across wikis.yml +++ b/.github/workflows/protect page across wikis.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: page: - description: 'Page to protect (prefix with namespace and use underscores!)' + description: 'Page to protect (prefix with namespace!)' required: true jobs: