Skip to content

Sync JSON Data

Sync JSON Data #6

Workflow file for this run

name: Sync JSON Data
on:
schedule:
- cron: '0 * * * *' # Run at midnight UTC daily
workflow_dispatch: # Allows manual trigger
permissions:
contents: write
jobs:
sync-json:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎
uses: actions/checkout@v4
- name: Fetch data 🏃🏻‍♂️
run: |
curl -L -s "https://script.google.com/macros/s/${{ secrets.KEY_APP_SCRIPT }}/exec?action=getData" -o public/law.json
- name: Commit and Push Changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add public/law.json
git commit -m "Sync JSON data from Google Apps Script"
git push origin main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}