Scan for new API assets #994
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
# This workflow will run the "tools/file_fetcher.py" script once a day, while | |
# also committing any changes to the repository. | |
name: Scan for new API assets | |
on: | |
schedule: | |
- cron: "0 0 * * *" | |
workflow_dispatch: {} | |
jobs: | |
backup: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v1 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install aiohttp aiofiles yarl | |
- name: Configure git | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
- name: Run file fetcher | |
run: | | |
python tools/file_fetcher.py ./images incremental --count 1000 | |
- name: Filter changes | |
run: | | |
git add images | |
git stash save --keep-index --include-untracked | |
- name: Commit and push relevant changes | |
continue-on-error: true | |
run: | | |
git commit -m "Automatic Asset Update" | |
git push origin main |