Skip to content

Update Air Quality Data #4580

Update Air Quality Data

Update Air Quality Data #4580

Workflow file for this run

name: Update Air Quality Data
on:
schedule:
- cron: '0 */4 * * *' # Runs every 4 hours
workflow_dispatch:
jobs:
update-data:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x' # Replace with your desired Python version
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests
- name: Run Python script
env:
AIR_QUALITY_API_KEY: ${{ secrets.AIR_QUALITY_API_KEY }}
run: python air_quality.py
- name: Commit changes
run: |
git config --local user.email "actions@github.com"
git config --local user.name "GitHub Actions"
git add data.json
git commit -m "Update data.json" -a
git push