Skip to content

ci: Declare minimum permissions on semantic-commit workflow#51

Merged
maks-m-mongo-leaf merged 1 commit into
mongodb:mainfrom
arpitjain099:chore/declare-workflow-perms
May 26, 2026
Merged

ci: Declare minimum permissions on semantic-commit workflow#51
maks-m-mongo-leaf merged 1 commit into
mongodb:mainfrom
arpitjain099:chore/declare-workflow-perms

Conversation

@arpitjain099

Copy link
Copy Markdown
Contributor

Declares permissions: contents: read, pull-requests: read at the workflow level on .github/workflows/semantic-commit.yaml. amannn/action-semantic-pull-request reads the PR title via the pulls API to validate conventional-commit format and reports the result as the workflow's own check status. That needs read on pull-requests and nothing else.

Worth declaring explicitly even when the inherited default may already be reasonable: CVE-2025-30066 (the March 2025 tj-actions/changed-files compromise) showed a tampered third-party action exfiltrating GITHUB_TOKEN from workflow logs and the leaked token retaining whatever scope was issued at the workflow level. A per-workflow cap bounds the runtime authority of every action that runs inside it irrespective of repo or org default, gives drift protection if that default ever widens, and registers with OpenSSF Scorecard's Token-Permissions check.

YAML validated locally with yaml.safe_load.

Signed-off-by: Arpit Jain <arpitjain099@gmail.com>

@maks-m-mongo-leaf maks-m-mongo-leaf left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@arpitjain099

Copy link
Copy Markdown
Contributor Author

Hi - just a gentle nudge for merge when you have a moment. @maks-m-mongo-leaf already approved.

@maks-m-mongo-leaf maks-m-mongo-leaf changed the title ci: declare minimum permissions on semantic-commit workflow CI: declare minimum permissions on semantic-commit workflow May 26, 2026
@maks-m-mongo-leaf maks-m-mongo-leaf changed the title CI: declare minimum permissions on semantic-commit workflow ci: declare minimum permissions on semantic-commit workflow May 26, 2026
@maks-m-mongo-leaf maks-m-mongo-leaf changed the title ci: declare minimum permissions on semantic-commit workflow ci: Declare minimum permissions on semantic-commit workflow May 26, 2026
@maks-m-mongo-leaf maks-m-mongo-leaf merged commit b2b6044 into mongodb:main May 26, 2026
6 of 9 checks passed
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