Skip to content

Refresh Release Data #28

Refresh Release Data

Refresh Release Data #28

Workflow file for this run

name: Refresh Release Data
on:
schedule:
# Run weekly on Thursdays at 9:00 UTC (after GB releases on Wednesday)
- cron: '0 9 * * 4'
workflow_dispatch:
inputs:
from_version:
description: 'Parse from version (optional)'
required: false
to_version:
description: 'Parse to version (optional)'
required: false
contributor_aggregates:
description: 'Contributor aggregates (sponsor/country breakdown)'
type: choice
default: 'auto'
options:
- 'auto'
- 'skip'
- 'force-all'
jobs:
refresh:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Parse releases
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [ -n "${{ github.event.inputs.from_version }}" ] || [ -n "${{ github.event.inputs.to_version }}" ]; then
ARGS=""
[ -n "${{ github.event.inputs.from_version }}" ] && ARGS="$ARGS --from ${{ github.event.inputs.from_version }}"
[ -n "${{ github.event.inputs.to_version }}" ] && ARGS="$ARGS --to ${{ github.event.inputs.to_version }}"
npm run data-sync:gb-releases -- $ARGS
else
npm run data-sync:gb-releases
fi
- name: Aggregate data
run: npm run data-sync:wp-cycles
- name: Compute contributor aggregates
if: ${{ github.event.inputs.contributor_aggregates != 'skip' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [ "${{ github.event.inputs.contributor_aggregates }}" == "force-all" ]; then
npm run data-sync:contributor-stats -- --force --delay 300
else
npm run data-sync:contributor-stats -- --delay 300
fi
- name: Check for changes
id: changes
run: |
git diff --quiet public/data/ || echo "changed=true" >> $GITHUB_OUTPUT
- name: Commit and push changes
if: steps.changes.outputs.changed == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add public/data/
git commit -m "Update release data
Automated refresh of Gutenberg release statistics."
git push