Skip to content

Potential fix for code scanning alert no. 3: Workflow does not contain permissions - #14

Merged
jwhollingsworth merged 1 commit into
mainfrom
alert-autofix-3
Oct 30, 2025
Merged

Potential fix for code scanning alert no. 3: Workflow does not contain permissions#14
jwhollingsworth merged 1 commit into
mainfrom
alert-autofix-3

Conversation

@jwhollingsworth

Copy link
Copy Markdown
Contributor

Potential fix for https://github.com/Coveros/codeveros-ms/security/code-scanning/3

To fix the problem, add a permissions block that restricts the permissions of the workflow’s jobs. Since neither job (build or publish-npm) writes to the repository or performs privileged operations outside of reading files and publishing to npm, set contents: read in the root of the workflow. This will restrict the workflow’s access token to only read repository contents, as needed for checking out code and testing, and for publishing packages. Insert the following block after the name: field in the YAML file:

permissions:
  contents: read

No imports or other code changes are necessary; simply add the permissions block at the workflow root, before on:.

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>
@jwhollingsworth
jwhollingsworth marked this pull request as ready for review October 30, 2025 16:29
@jwhollingsworth
jwhollingsworth merged commit 063bcb8 into main Oct 30, 2025
4 checks passed
@jwhollingsworth
jwhollingsworth deleted the alert-autofix-3 branch October 30, 2025 17:00
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