Build Repo Reports #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Repo Reports | |
on: | |
workflow_dispatch: | |
schedule: | |
# Runs at 00:00 on the first day of each month | |
- cron: "0 0 1 * *" | |
jobs: | |
generate_reports: | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 1 | |
matrix: | |
repo_data: | |
- { | |
input_file: "backend_framework_urls.txt", | |
output_file: "backend_framework_report.json", | |
} | |
- { input_file: "comp_urls.txt", output_file: "comp_report.json" } | |
- { | |
input_file: "mobile_desktop_urls.txt", | |
output_file: "mobile_desktop_report.json", | |
} | |
- { | |
input_file: "state_management_urls.txt", | |
output_file: "state_management_report.json", | |
} | |
- { | |
input_file: "ui_framework_urls.txt", | |
output_file: "ui_framework_report.json", | |
} | |
- { input_file: "chart_urls.txt", output_file: "chart_report.json" } | |
- { input_file: "db_urls.txt", output_file: "db_report.json" } | |
- { | |
input_file: "monitoring_urls.txt", | |
output_file: "monitoring_report.json", | |
} | |
- { input_file: "test_urls.txt", output_file: "test_report.json" } | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
working-directory: api | |
- name: Update Report | |
run: |- | |
python repo_report.py "${{ matrix.repo_data.input_file }}" "${{ matrix.repo_data.output_file }}" | |
working-directory: api | |
env: | |
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
- name: Commit and push if changed | |
run: |- | |
git diff | |
git config --global user.email "readme-bot@example.com" | |
git config --global user.name "README-bot" | |
git add -A | |
git commit -m "Updated ${{ matrix.repo_data.output_file }}" || exit 0 | |
git pull --rebase origin main | |
git push |