deepmodeling / deepmodeling/deepmodeling_sphinx

[Code scan] Limit PyPI OIDC permission to tag publish jobs

Open
#91 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
CSS
Stars
2
Forks
6
PR merge metrics
No merged PRs in 30d

Description

This issue is a result of a Codex global code scan of deepmodeling/deepmodeling_sphinx at commit 156679fe55fc61e8ec3b1e9be8a45fde3567b9cb.

Problem

The PyPI release workflow runs on all pushes and pull requests, grants `id-token: write` to the whole job, and only gates the final publishing step on tag pushes. The build steps do not need PyPI trusted-publishing OIDC permission.

Code references:

https://github.com/deepmodeling/deepmodeling_sphinx/blob/156679fe55fc61e8ec3b1e9be8a45fde3567b9cb/.github/workflows/release.yml#L1-L9
https://github.com/deepmodeling/deepmodeling_sphinx/blob/156679fe55fc61e8ec3b1e9be8a45fde3567b9cb/.github/workflows/release.yml#L17-L24

Impact

OIDC token minting is available during non-publish job runs. The final PyPI upload is guarded, but least privilege would keep publish credentials unavailable to branch and pull-request builds.

Suggested fix

Split build/test from publish, or add a tag-only job-level condition for the publishing job. Keep `id-token: write` only on the publish job, and set the remaining permissions explicitly, for example `contents: read` for checkout.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.