Skip to content

Conversation

@aamoghS
Copy link
Member

@aamoghS aamoghS commented Jan 1, 2026

Potential fix for https://github.com/DataScience-GT/query/security/code-scanning/1

In general, fix this by explicitly declaring minimal GITHUB_TOKEN permissions for the workflow or for each job. For a pure build job that only checks out code and runs local commands, contents: read is usually sufficient. Add a permissions block either at the root level (applies to all jobs) or under the build job (applies only to that job).

The best minimal change here is to add a job-level permissions block under jobs.build, just above runs-on. This avoids affecting any other jobs that might be added later and keeps the change clearly scoped. No other functionality changes are required, and no imports or dependencies are involved because this is a YAML configuration file.

Concretely, in .github/workflows/pnpm-build.yml, modify the build job definition so that:

  build:
+   permissions:
+     contents: read
    runs-on: ubuntu-latest

This explicitly restricts the GITHUB_TOKEN for this job to read-only access to repository contents.

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>
@aamoghS aamoghS marked this pull request as ready for review January 1, 2026 15:03
@aamoghS aamoghS merged commit c13436e into main Jan 1, 2026
5 checks passed
@aamoghS aamoghS deleted the alert-autofix-1 branch January 1, 2026 15:34
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