Skip to content

Update Community Stats #12

Update Community Stats

Update Community Stats #12

name: Update Community Stats
on:
schedule:
- cron: '0 */4 * * *' # Every 4 hours
workflow_dispatch:
permissions:
contents: read
jobs:
update-community:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: '24'
- name: Install dependencies
run: npm install node-fetch
- name: Fetch Discourse activity
run: node .github/scripts/fetch-discourse-activity.js
- name: Create GitHub App token
id: app-token
uses: actions/create-github-app-token@v3
with:
client-id: ${{ vars.AUTOMATION_APP_CLIENT_ID }}
private-key: ${{ secrets.AUTOMATION_APP_PRIVATE_KEY }}
- name: Create pull request for updated community stats
uses: peter-evans/create-pull-request@v8.1.1
with:
token: ${{ steps.app-token.outputs.token }}
add-paths: data/community_stats.json
branch: automation/update-community-stats
commit-message: Update community stats
title: Update community stats
body: Automated update from the PowerShell.org community forum.
delete-branch: true