ci: declare contents:read on node-gyp integration workflow#346
Merged
legendecas merged 1 commit intoMay 14, 2026
Conversation
Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
There was a problem hiding this comment.
Pull request overview
Adds an explicit minimal permissions: contents: read block to the node-gyp integration workflow to bound GITHUB_TOKEN scope, providing defense against compromised third-party actions and drift protection against repo/org default changes.
Changes:
- Declares top-level
permissions: contents: readin.github/workflows/node-gyp.yml.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cclauss
approved these changes
May 14, 2026
legendecas
approved these changes
May 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Declares
permissions: contents: readat the top of.github/workflows/node-gyp.yml. The integration job checks out the repo, sets up Node and Python across a few versions, installsnode-gyp, then drives a small build matrix. No part of that path needs anything beyond read on the contents.CVE-2025-30066 (the March 2025
tj-actions/changed-filessupply-chain attack) is the reason this kind of cap matters in practice: a compromised third-party action can readGITHUB_TOKENout of workflow logs, and the leaked token retains whatever scope was issued. Adding an in-filecontents: readblock bounds the runtime authority for this workflow regardless of what the repo or org default happens to be set to today, and it gives drift protection if that default ever changes. OpenSSF Scorecard's Token-Permissions check looks for the explicit per-workflow block too.YAML validated locally via
yaml.safe_load.