Skip to content

ci: declare contents:read on Deploy Agent CI workflow#1949

Open
arpitjain099 wants to merge 1 commit into
pinterest:masterfrom
arpitjain099:chore/python-ci-permissions
Open

ci: declare contents:read on Deploy Agent CI workflow#1949
arpitjain099 wants to merge 1 commit into
pinterest:masterfrom
arpitjain099:chore/python-ci-permissions

Conversation

@arpitjain099
Copy link
Copy Markdown

The Deploy Agent CI workflow currently doesn't declare a permissions: block, so the workflow GITHUB_TOKEN falls back to whatever the repository default grants. The single build job only runs actions/checkout, actions/setup-python, pip install tox tox-gh-actions, and tox -v. No GitHub API write, no cache plumbing.

This patch sets permissions: contents: read at workflow scope, matching the per-job permission blocks already declared by codeql-analysis.yml (actions: read, contents: read, security-events: write) and labeler.yml.

Third-party action exposure: actions/checkout, actions/setup-python. Both are first-party from actions/*, so the defense-in-depth argument here is less strong than for repos heavy on third-party actions, but the cost of pinning the scope is one line and the benefit (Token-Permissions check passing, scope contract documented in-file) is real.

maven.yml is deliberately out of scope because it uses cache: 'maven' in setup-java, which interacts with the cache-save path; that deserves a separate look.

pre-commit.yml is 16 lines and below the noise floor.

The Deploy Agent CI workflow only runs tox over a Python matrix. No
GitHub API write, no cache. `permissions: contents: read` makes that
explicit and matches the per-job permissions blocks already used in
codeql-analysis.yml and labeler.yml.

Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
@arpitjain099 arpitjain099 requested a review from a team as a code owner May 14, 2026 01:30
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.

1 participant