Skip to content

Fetch MongoDB Data

Fetch MongoDB Data #2

Workflow file for this run

name: Fetch MongoDB Data
on:
schedule:
- cron: '0 0 * * 0' # Runs weekly on Sunday at midnight
workflow_dispatch:
jobs:
fetch_data:
runs-on: ubuntu-latest
steps:
- name: Checkout master branch
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install MongoDB client
run: |
python -m pip install --upgrade pip
pip install pymongo
- name: Fetch Data from MongoDB
env:
MONGODB_URI: ${{ secrets.MONGODB_URI }}
run: |
python fetch_data.py
- name: Commit and Push changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add -A
git commit -m "Update data files" || true
git push