Skip to content

Update Community Stats #408

Update Community Stats

Update Community Stats #408

name: Update Community Stats
on:
schedule:
- cron: '0 */4 * * *' # Every 4 hours
workflow_dispatch:
jobs:
update-community:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install dependencies
run: npm install node-fetch
- name: Fetch Discourse activity
run: node .github/scripts/fetch-discourse-activity.js
- name: Commit updates
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add data/community_stats.json
git diff --staged --quiet || git commit -m "Update community stats"
git push