Skip to content

Auto-update API

Auto-update API #560

Workflow file for this run

name: Auto-update API
on:
schedule:
- cron: '*/5 * * * *'
push:
branches:
- main
jobs:
update-json:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
token: ${{ secrets.TROPITRACKER_API }}
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 23
- name: Install dependencies
run: npm install
- name: Run script to update API
run: npm test
- name: Commit updated JSON files
env:
GH_TOKEN: ${{ secrets.TROPITRACKER_API }}
run: |
git config --global user.name "github-actions"
git config --global user.email "github-actions@github.com"
git add index.json
git add outlooks.json
git add hurricanes.json
git add tropical-storms.json
git add tropical-depressions.json
git commit -m "Auto-update API"
git push