Skip to content

CI: declare workflow-level permissions: {}#1811

Merged
hugovk merged 2 commits into
python:mainfrom
arpitjain099:chore/declare-workflow-perms
May 26, 2026
Merged

CI: declare workflow-level permissions: {}#1811
hugovk merged 2 commits into
python:mainfrom
arpitjain099:chore/declare-workflow-perms

Conversation

@arpitjain099
Copy link
Copy Markdown
Contributor

Pins the default GITHUB_TOKEN to contents: read at workflow level. No GitHub API writes from the workflow.

Post-CVE-2025-30066 hardening pattern. YAML validated locally.

Workflow runs checks only; no GitHub API writes. Post-CVE-2025-30066 hardening pattern.

Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
@python-cla-bot
Copy link
Copy Markdown

python-cla-bot Bot commented May 25, 2026

All commit authors signed the Contributor License Agreement.

CLA signed

Comment thread .github/workflows/ci.yml Outdated
Comment on lines +8 to +9
permissions:
contents: read
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or even less:

Suggested change
permissions:
contents: read
permissions: {}

Comment thread .github/workflows/lint.yml Outdated
Comment on lines +5 to +6
permissions:
contents: read
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
permissions:
contents: read
permissions: {}

Per @hugovk on python#1811: drop `contents: read` to deny-all `permissions: {}`. Both workflows only run `actions/checkout` against a public repo (which falls back to unauthenticated clone with no token scope) plus python/uv/pre-commit setup, none of which call the GitHub API.

Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
@arpitjain099
Copy link
Copy Markdown
Contributor Author

Done @hugovk - both files now use permissions: {} per your suggestion. Pushed.

@read-the-docs-community
Copy link
Copy Markdown

Documentation build overview

📚 CPython devguide | 🛠️ Build #32850732 | 📁 Comparing 427852d against latest (c2b831f)

  🔍 Preview build  

1 file changed
± versions/index.html

@hugovk hugovk changed the title ci: declare workflow-level contents: read on ci and lint CI: declare workflow-level permissions: {} May 26, 2026
@hugovk hugovk merged commit 35a435a into python:main May 26, 2026
5 checks passed
@hugovk
Copy link
Copy Markdown
Member

hugovk commented May 26, 2026

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants