Potential fixes for 2 code scanning alerts
-
https://github.com/github/prettier-config/security/code-scanning/2 To fix the issue, add a
permissionsblock with explicit least privilege to thepublish-npmjob. As the job only needs to publish to npm (using a personal access token fromsecrets.npm_token) and does not perform any package write operations requiringGITHUB_TOKEN, the minimum necessary permission is likelycontents: read. This block should be inserted directly under the job name (immediately afterpublish-npm:and beforeruns-on:) in thepublish-npmjob. No other code changes or imports are required.
-
https://github.com/github/prettier-config/security/code-scanning/1 To fix the problem, you should add the
permissionsblock to the workflow. Since this workflow does not contain any steps which create or modify repository content, issues, or pull requests, the minimal permission required iscontents: read. You should add the following block immediately below thename:declaration at the top of the.github/workflows/test.ymlfile, which will set this as the default permission for all jobs in the workflow. No changes to existing functionality will occur. No new imports or definitions are required.
Suggested fixes powered by Copilot Autofix. Review carefully before merging.