From 867a8c036382ee0049c74688ce29b634bf911260 Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Thu, 5 Mar 2026 02:16:25 +0100 Subject: [PATCH 1/4] Create protect new wiki.yml --- .github/workflows/protect new wiki.yml | 49 ++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/protect new wiki.yml diff --git a/.github/workflows/protect new wiki.yml b/.github/workflows/protect new wiki.yml new file mode 100644 index 00000000000..fa531ac99a7 --- /dev/null +++ b/.github/workflows/protect new wiki.yml @@ -0,0 +1,49 @@ +name: Protect newly set up wiki + +on: + workflow_dispatch: + inputs: + wiki: + description: 'Wiki to set up' + required: true + +jobs: + protect: + if: github.ref_name == github.event.repository.default_branch + name: Protect modules and templates on newly set up wiki + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v6 + + - name: Setup Python + id: setup + uses: actions/setup-python@v6 + with: + python-version: '3.14' + + - name: Install Python Dependency + id: dependencies + run: pip install requests + + - name: Template 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 }} + WIKI_TO_PROTECT: ${{ github.event.inputs.wiki }} + PYTHONUNBUFFERED: 1 + run: python3 ./scripts/protect_templates.py + + - name: Lua Protect + #if condition is needed this way to ensure it runs even if template protect fails + if: always() && steps.setup.outcome == 'success' && steps.dependencies.outcome == 'success' + 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 }} + WIKI_TO_PROTECT: ${{ github.event.inputs.wiki }} + PYTHONUNBUFFERED: 1 + run: python3 ./scripts/protect.py From dd0c154cf47eec7f77b7b4e99ba2d19ea6be7f19 Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Thu, 5 Mar 2026 02:20:02 +0100 Subject: [PATCH 2/4] Delete .github/workflows/protect new wiki templates.yml --- .../workflows/protect new wiki templates.yml | 35 ------------------- 1 file changed, 35 deletions(-) delete mode 100644 .github/workflows/protect new wiki templates.yml diff --git a/.github/workflows/protect new wiki templates.yml b/.github/workflows/protect new wiki templates.yml deleted file mode 100644 index 3b1542f5a2b..00000000000 --- a/.github/workflows/protect new wiki templates.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Protect newly set up wiki - -on: - workflow_dispatch: - inputs: - wiki: - description: 'Wiki to set up' - required: true - -jobs: - protect: - if: github.ref_name == github.event.repository.default_branch - name: Protect modules on newly set up wiki - 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: Template 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 }} - WIKI_TO_PROTECT: ${{ github.event.inputs.wiki }} - PYTHONUNBUFFERED: 1 - run: python3 ./scripts/protect_templates.py From 42ed4d789bc271fe05f8f6fb5c1e8986a949dfc8 Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Thu, 5 Mar 2026 02:20:19 +0100 Subject: [PATCH 3/4] Delete .github/workflows/protect new wiki modules.yml --- .../workflows/protect new wiki modules.yml | 35 ------------------- 1 file changed, 35 deletions(-) delete mode 100644 .github/workflows/protect new wiki modules.yml diff --git a/.github/workflows/protect new wiki modules.yml b/.github/workflows/protect new wiki modules.yml deleted file mode 100644 index 6bb1caafa9a..00000000000 --- a/.github/workflows/protect new wiki modules.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Protect newly set up wiki - -on: - workflow_dispatch: - inputs: - wiki: - description: 'Wiki to set up' - required: true - -jobs: - protect: - if: github.ref_name == github.event.repository.default_branch - name: Protect modules on newly set up wiki - 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: Lua 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 }} - WIKI_TO_PROTECT: ${{ github.event.inputs.wiki }} - PYTHONUNBUFFERED: 1 - run: python3 ./scripts/protect.py From 65461961a0079e514e2e15edc46dc1ba18486116 Mon Sep 17 00:00:00 2001 From: hjpalpha Date: Thu, 5 Mar 2026 09:15:54 +0100 Subject: [PATCH 4/4] as per review --- .github/workflows/protect new wiki.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/protect new wiki.yml b/.github/workflows/protect new wiki.yml index fa531ac99a7..790e482f590 100644 --- a/.github/workflows/protect new wiki.yml +++ b/.github/workflows/protect new wiki.yml @@ -17,7 +17,6 @@ jobs: - uses: actions/checkout@v6 - name: Setup Python - id: setup uses: actions/setup-python@v6 with: python-version: '3.14' @@ -38,7 +37,7 @@ jobs: - name: Lua Protect #if condition is needed this way to ensure it runs even if template protect fails - if: always() && steps.setup.outcome == 'success' && steps.dependencies.outcome == 'success' + if: always() && steps.dependencies.outcome == 'success' env: WIKI_USER: ${{ secrets.LP_BOTUSER }} WIKI_PASSWORD: ${{ secrets.LP_BOTPASSWORD }}