Skip to content

Update Projects JSON #25

Update Projects JSON

Update Projects JSON #25

Workflow file for this run

name: Update Projects JSON
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
jobs:
update-json:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install dependencies
run: npm ci
- name: Update projects.json
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: node scripts/fetch-github-data.js
- name: Commit and push changes if needed
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git diff --exit-code || (git add public/projects.json && git commit -m 'Update projects.json with latest GitHub data' && \
git remote set-url origin https://x-access-token:${GH_TOKEN}@github.com/AI4REALNET/.github.io.git && \
git push)
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}