audio streaming app plyr.fm
38
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: tie costs export to production release tag (#1166)

the hourly costs export was running from main, so schema changes
(like audd → copyright_scanning in #1163) broke the prod /costs
page before the frontend was released.

- checkout latest release tag in export-costs.yml
- add CI-only guard to export_costs.py (refuse non-dry-run locally)
- add pre-commit hook to catch stale privacy policy dates
- filed #1165 for moderation staging environment

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

authored by

nate nowack
Claude Opus 4.6
and committed by
GitHub
f8fa8ff0 0e2c493d

+107
+8
.github/workflows/export-costs.yml
··· 31 31 runs-on: ubuntu-latest 32 32 33 33 steps: 34 + - name: get latest release tag 35 + id: release 36 + run: echo "tag=$(gh release view --json tagName -q .tagName)" >> "$GITHUB_OUTPUT" 37 + env: 38 + GH_TOKEN: ${{ github.token }} 39 + 34 40 - uses: actions/checkout@v4 41 + with: 42 + ref: ${{ steps.release.outputs.tag }} 35 43 36 44 - uses: astral-sh/setup-uv@v4 37 45
+7
.pre-commit-config.yaml
··· 48 48 files: ^frontend/.*\.(ts|svelte)$ 49 49 pass_filenames: false 50 50 51 + - id: check-legal-dates 52 + name: check legal dates 53 + entry: python scripts/check_legal_dates.py 54 + language: system 55 + files: ^frontend/src/routes/privacy/ 56 + pass_filenames: true 57 + 51 58 - id: cargo-check-moderation 52 59 name: cargo check (moderation) 53 60 entry: bash -c 'cd services/moderation && cargo check --quiet'
+5
scripts/costs/export_costs.py
··· 13 13 14 14 import asyncio 15 15 import json 16 + import os 16 17 import re 17 18 from datetime import UTC, datetime, timedelta 18 19 from typing import Any ··· 213 214 env: str = typer.Option("prd", "--env", "-e", help="environment: prd, stg, dev"), 214 215 ) -> None: 215 216 """export platform costs to R2 for public dashboard""" 217 + if not os.environ.get("CI") and not dry_run: 218 + typer.echo("costs export should only run in CI (GitHub Actions)") 219 + typer.echo(" use --dry-run for local testing") 220 + raise typer.Exit(1) 216 221 217 222 async def run(): 218 223 db_url = settings.get_db_url(env)