Commit 7a9aedc
ci: declare workflow-scope permissions on five workflows (#478)
Summary:
Five workflows currently don't declare a `permissions:` block, so the workflow `GITHUB_TOKEN` falls back to the repository default. This patch pins each to its minimum:
- `.github/workflows/build-and-test.yml` -- `contents: read`. Matrix tests across Ubuntu/macOS/Windows and Python 3.9-3.14. No GitHub API write.
- `.github/workflows/coverage.yml` -- `contents: read`. `pytest --cov` plus `actions/upload-artifact@v4` for the coverage reports. Artifact upload in v4 doesn't require explicit permissions.
- `.github/workflows/deploy-website.yml` -- `contents: write`. The deploy step is `peaceiris/actions-gh-pages@v4` pushing the Docusaurus build to `gh-pages` via `${{ secrets.GITHUB_TOKEN }}`.
- `.github/workflows/notebook-ci.yml` -- `contents: read`. Executes `tutorials/balance_diff_diff_brfss.ipynb` via Papermill. No GitHub API write.
- `.github/workflows/release.yml` -- `contents: read`. Runs the test matrix and `pypa/gh-action-pypi-publish` against PyPI using `PYPI_API_TOKEN`. The workflow `GITHUB_TOKEN` is unused for the publish.
The pattern matches `codeql.yml` (per-job `actions: read, contents: read, security-events: write`), `diff-diff-canary.yml` (workflow-level `contents: read, issues: write` plus a per-job override), and `cleanup-copilot-artifacts.yml` (workflow-level `actions: write`).
Third-party action exposure that motivates pinning: `peaceiris/actions-gh-pages`, `pypa/gh-action-pypi-publish`, `actions/setup-python`, `actions/setup-node`. Explicit per-workflow scopes narrow the blast radius if any is compromised (cf. `tj-actions/changed-files` CVE-2025-30066).
No behavioural change to any of the five.
Pull Request resolved: #478
Differential Revision: D105128528
Pulled By: talgalili
fbshipit-source-id: 2621bd590d3b1597123dbffd4de6e500877039411 parent a555ce0 commit 7a9aedc
5 files changed
Lines changed: 15 additions & 0 deletions
File tree
- .github/workflows
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
14 | 17 | | |
15 | 18 | | |
16 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
10 | 13 | | |
11 | 14 | | |
12 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
7 | 10 | | |
8 | 11 | | |
9 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
42 | 45 | | |
43 | 46 | | |
44 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
10 | 13 | | |
11 | 14 | | |
12 | 15 | | |
| |||
0 commit comments