Skip to content

Update commons-update.yml #11

Update commons-update.yml

Update commons-update.yml #11

on:
push:
branches: [ "main"]
pull_request:
branches: [ "main" ]
schedule:
- cron: '0 23 * * *'
permissions: read-all
env:
PYWIKIBOT_TEST_RUNNING: 1
PYWIKIBOT_USERNAME: Athulvis
PYWIKIBOT_LOGIN_LOGOUT: 1
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 1
matrix:
python-version: ["3.10"]
site: ['commons:commons']
include:
- python-version: 3.10
site: commons:commons
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Generate user files
run: |
pwb generate_user_files -site:${{matrix.site}} -user:${{ env.PYWIKIBOT_USERNAME }} -v -debug;
echo "usernames['commons']['commons'] = '${{ env.PYWIKIBOT_USERNAME }}'" >> user-config.py
echo "max_retries = 3" >> user-config.py
echo "noisysleep = float('inf')" >> user-config.py
echo "maximum_GET_length = 5000" >> user-config.py
echo "console_encoding = 'utf8'" >> user-config.py
echo "import os" >> user-config.py
echo "password_file = os.path.expanduser('passwordfile')" >> user-config.py
echo "('${{ env.PYWIKIBOT_USERNAME }}', '${{ secrets.PWD }}')" > passwordfile
- name: Update Commons
timeout-minutes: 10
run: |
pwb wikiupdater