feat: publish secure dynamic repository metrics - #9
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a6b0859ab7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| - uses: actions/checkout@v7 | ||
| - name: Render privacy-safe metrics SVG | ||
| env: | ||
| GITHUB_TOKEN: ${{ github.token }} |
There was a problem hiding this comment.
Supply a token permitted to read repository traffic
The workflow GITHUB_TOKEN can only receive the permissions exposed under permissions:, and contents: write does not grant the Administration (read) permission required by the /traffic/views and /traffic/clones endpoints called by fetch_snapshot(). Consequently, every watch, scheduled, or manual run reaches those calls with ${{ github.token }} and receives a 403 before generating or publishing the SVG; use a GitHub App or other credential with repository traffic access, keeping the branch-push credential separate if necessary.
Useful? React with 👍 / 👎.
Summary
metricsbranch without embedding a long-lived tokenValidation
PYTHONPATH=src python3 -m unittest discover -s tests -v(77 passed)python3 scripts/privacy_scan.pyactionlint .github/workflows/repository-metrics.yml