Skip to content

Scheduled Data Fetch and Update #33

Scheduled Data Fetch and Update

Scheduled Data Fetch and Update #33

Workflow file for this run

name: Scheduled Data Fetch and Update
on:
schedule:
- cron: "0 0 * * *" # Runs every day at midnight
jobs:
update-repo:
runs-on: ubuntu-latest
steps:
# Checkout your repository
- name: Update Catalog
uses: actions/checkout@v3
# Set up Node.js environment
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "23"
# Install dependencies
- name: Install dependencies
run: npm install
# Run Node.js script to fetch data and update repository
- name: Run data fetch script
run: node updateCatalog.js
# Commit and push changes back to your repository
- name: Commit changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "Update repository with fetched data"
git push https://x-access-token:${{ secrets.PAT_TOKEN }}@github.com/epiverse/catalog.git HEAD:main