Scrap latest data from pollen.lu and commit changes #13903
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
name: Scrap latest data from pollen.lu and commit changes | |
on: | |
schedule: | |
- cron: '0 * * * *' # every hour | |
jobs: | |
update-data: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.PAT }} | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20.5 | |
- name: NPM install | |
run: npm ci | |
- name: Scrap latest data from pollen.lu | |
run: npm run scrap-latest-data | |
- name: Check if there are any changes | |
id: verify_diff | |
run: | | |
git diff --quiet . || echo "changed=true" >> $GITHUB_OUTPUT | |
- name: Commit updated data | |
if: steps.verify_diff.outputs.changed == 'true' | |
run: | | |
git config --global user.name 'Pollen.lu scrapper' | |
git config --global user.email '[email protected]' | |
git add . | |
git commit -am "Update pollen.lu data" | |
git push |