Skip to content

temporarily moving data/reports outside of src #7

temporarily moving data/reports outside of src

temporarily moving data/reports outside of src #7

Workflow file for this run

name: Weekly PFD Top-Up
on:
# workflow_dispatch:
push:
branches:
- auto_update
# # Automatically trigger every Monday at 1:00 AM UTC
# schedule:
# - cron: '0 1 * * 1' # ...Format: Minute Hour Day Month Weekday (UTC timezone)
permissions:
contents: write
jobs:
scrape:
runs-on: ubuntu-latest
steps:
# - name: Check if on main branch # ...exit if not on main branch
# if: github.ref != 'refs/heads/main'
# run: |
# echo "This workflow is designed to run on main only."
# exit 0
- name: Checkout Repository Code
uses: actions/checkout@v4
- name: Install UV
uses: astral-sh/setup-uv@v5
with:
enable-cache: true # ...caches installed dependencies for faster subsequent runs
cache-dependency-glob: "uv.lock" # ...cache is invalidated if uv.lock changes
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: "pyproject.toml"
- name: Create virtual environment
run: uv venv .venv
- name: Install Project Dependencies via UV
run: uv sync
- name: Run the PFD Top-Up Script
run: uv run python scripts/update_reports.py
- name: Display Summary in Actions UI
if: always()
run: |
summary=".github/workflows/update_summary.txt"
echo "### 📊 PFD Reports Summary" >> $GITHUB_STEP_SUMMARY
if [ -f "$summary" ]; then
cat "$summary" >> $GITHUB_STEP_SUMMARY
else
echo "ℹ️ You have commitment issues! (No new reports found)" >> $GITHUB_STEP_SUMMARY
fi
- name: Commit & Push Changes
if: github.ref == 'refs/heads/auto_update'
uses: EndBug/add-and-commit@v9
with:
add: src/pfd_toolkit/data/all_reports.csv
default_author: github_actions
message: "🤖 Weekly PFD data top-up"