Skip to content

Scrape pokémon list #998

Scrape pokémon list

Scrape pokémon list #998

Workflow file for this run

name: Scrape pokémon list
on:
schedule:
- cron: "20 4 * * 1,4"
workflow_dispatch:
jobs:
scrape:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12.2"
cache: 'pip'
- run: pip install -r ci-requirements.txt
- run: pip install -r requirements.txt
- run: python scrape_pokemon.py > pokemon.txt
- id: compare
run: git diff --quiet pokemon.txt || echo "changed=1" >> $GITHUB_ENV
- name: Commit and push
if: ${{ env.changed == 1 }}
run: |
git config user.email "[email protected]"
git config user.name "codl"
git commit -m "Update list of pokémon" --author="Actions <[email protected]>" pokemon.txt
git push --force origin main:update-scrape
- name: pull-request-action
if: ${{ env.changed == 1 }}
uses: vsoch/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PULL_REQUEST_BRANCH: "main"
PULL_REQUEST_FROM_BRANCH: "update-scrape"
PULL_REQUEST_ASSIGNEES: "codl"
PULL_REQUEST_TITLE: "Update list of pokémon"