Skip to content

Commit

Permalink
edit: add github token
Browse files Browse the repository at this point in the history
  • Loading branch information
nitikornbunya committed Sep 4, 2024
1 parent 4602c47 commit 3759f09
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions .github/workflows/sync-app-script.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ name: Sync JSON Data

on:
schedule:
# This schedule will run every day at midnight UTC (modify as needed)
- cron: '0 * * * *'
- cron: '0 * * * *' # Run at midnight UTC daily
workflow_dispatch: # Allows manual trigger

permissions:
Expand All @@ -19,15 +18,6 @@ jobs:
with:
ssh-key: ${{ secrets.KEY_UPDATE_LAWS_DATA }} # Ensure that this SSH key has proper permissions

- name: Setup node env πŸ—
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: yarn

- name: Install dependencies πŸ‘¨πŸ»β€πŸ’»
run: yarn --ignore-engines

- name: Fetch data πŸƒπŸ»β€β™‚οΈ
run: |
curl -s "https://script.google.com/macros/s/${{ secrets.KEY_APP_SCRIPT }}/exec?action=getData" -o data/laws.json
Expand All @@ -38,4 +28,6 @@ jobs:
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add data/laws.json
git commit -m "Sync JSON data from Google Apps Script"
git push origin HEAD:refs/heads/main
git push origin main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 3759f09

Please sign in to comment.