Update commons-update.yml #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: [ "main"] | |
pull_request: | |
branches: [ "main" ] | |
schedule: | |
- cron: '0 23 * * *' | |
permissions: read-all | |
env: | |
PYWIKIBOT_TEST_RUNNING: 1 | |
PYWIKIBOT_USERNAME: Athulvis | |
PYWIKIBOT_BOTNAME: keralacovidvaccineUpdater | |
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 python3-dotenv | |
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 "family = 'commons'" >> user-config.py | |
echo "mylang = 'commons'" >> user-config.py | |
echo "usernames['commons']['commons'] = '${{ env.PYWIKIBOT_USERNAME }}'" >> user-config.py | |
echo "password_file = 'user-password.py'" >> 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 "('${{ env.PYWIKIBOT_USERNAME }}', BotPassword('${{ env.PYWIKIBOT_BOTNAME }}','${{ secrets.PWD }}'))" > user-password.py | |
- name: Update Commons | |
timeout-minutes: 10 | |
run: | | |
pwb wikiupdater |