Skip to content

Generate Monthly Learning Path Report #18

Generate Monthly Learning Path Report

Generate Monthly Learning Path Report #18

name: Generate Monthly Learning Path Report
on:
workflow_dispatch:
inputs:
month:
description: 'Month to generate report for (YYYY-MM format)'
required: false
month_range:
description: 'Month range to generate report for (YYYY-MM YYYY-MM format)'
required: false
jobs:
generate-report:
runs-on: ubuntu-24.04-arm
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Create reports directory if not exists
run: mkdir -p reports
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r tools/requirements.txt
- name: Generate monthly report
env:
PAT: ${{ secrets.PAT }}
run: |
if [ -n "${{ github.event.inputs.month_range }}" ]; then
RANGE=(${{ github.event.inputs.month_range }})
python tools/generate-monthly-report.py --month-range ${RANGE[0]} ${RANGE[1]}
elif [ -n "${{ github.event.inputs.month }}" ]; then
python tools/generate-monthly-report.py --month ${{ github.event.inputs.month }}
else
python tools/generate-monthly-report.py
fi
- name: Commit and push report to repository
run: |
git config user.name github-actions
git config user.email [email protected]
git add reports/
git commit -m "Add monthly learning path report [skip ci]" || echo "No changes to commit"
git push
env:
GITHUB_TOKEN: ${{ secrets.PAT }}