Daily Update #2265
This file contains hidden or 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
| name: Daily Update | |
| on: | |
| schedule: | |
| - cron: '0 5 * * *' | |
| jobs: | |
| update: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| cache: 'pip' | |
| - name: Install requirements | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install wheel | |
| pip install -r scripts/requirements.txt | |
| playwright install firefox | |
| pip install csv-diff | |
| - name: Copy old version | |
| run: cp data/ndcs.csv data/ndcs-old.csv | |
| - name: Update data | |
| run: python scripts/process.py | |
| - name: Diff files | |
| run: csv-diff data/ndcs-old.csv data/ndcs.csv --key=EncodedAbsUrl >> message.txt | |
| - name: Commit back | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| git config user.email "<>" | |
| git config user.name "Update Bot" | |
| git checkout main | |
| git add data/ndcs.csv | |
| git add data/ndcs.json | |
| git commit -F message.txt && \ | |
| git push https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git main && \ | |
| git log -n 1 || true | |