Skip to content

Potential fix for code scanning alert no. 1: Workflow does not contain permissions#17

Merged
prashanthvarma merged 1 commit intomainfrom
alert-autofix-1
Feb 4, 2026
Merged

Potential fix for code scanning alert no. 1: Workflow does not contain permissions#17
prashanthvarma merged 1 commit intomainfrom
alert-autofix-1

Conversation

@prashanthvarma
Copy link
Collaborator

Potential fix for https://github.com/Graphiant-Inc/graphiant-sdk-python/security/code-scanning/1

In general, the fix is to add an explicit permissions: block to the workflow (either at the root, applying to all jobs, or inside the specific job) and restrict GITHUB_TOKEN to the minimal needed scopes. For this build-only workflow, the job just checks out code, sets up Python, installs dependencies, builds the package, uploads artifacts, and verifies output; none of these require write access to the repository or other resources via GITHUB_TOKEN. Therefore, we can set contents: read and omit all other permissions, which default to none.

The best way to fix this without altering behavior is to add a root-level permissions: block immediately after the name: Build SDK line, specifying contents: read. This will apply to all jobs in the workflow (currently just build) and does not interfere with any of the steps, which only read from the repository. No additional imports or methods are needed because this is configuration-only. No further changes to steps, triggers, or actions are required.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

…n permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: Prashanth Varma Manthena <me@prashanthvarma.com>
@prashanthvarma prashanthvarma marked this pull request as ready for review February 4, 2026 07:42
@prashanthvarma prashanthvarma requested a review from a team February 4, 2026 07:42
@prashanthvarma prashanthvarma merged commit 8ef83d8 into main Feb 4, 2026
7 checks passed
@prashanthvarma prashanthvarma deleted the alert-autofix-1 branch February 4, 2026 07:42
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