Skip to content

Generate single Consolidated JSON Report #43

Generate single Consolidated JSON Report

Generate single Consolidated JSON Report #43

name: Generate single Consolidated JSON Report
on:
schedule:
- cron: '0 1 * * *' # Runs daily at 01:00 UTC
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
generate:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.14'
- name: Generate consolidated report
run: python scripts/consolidate.py
- name: Create or update PR with report
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
BRANCH="automation/publish-report"
git checkout -B "$BRANCH"
git add _plugin-modernizer-stats-report/report.json
git diff --cached --quiet && echo "No changes to commit" && exit 0
git commit -m "chore(report): update single consolidated report.json"
git push --force origin "$BRANCH"
EXISTING_PR=$(gh pr list --head "$BRANCH" --state open --json number --jq '.[0].number')
if [ -z "$EXISTING_PR" ]; then
gh pr create --title "chore(report): update single consolidated report.json" \
--body "This PR automatically updates the single consolidated _plugin-modernizer-stats-report/report.json." \
--head "$BRANCH" --base main
fi