Potential fix for code scanning alert no. 1: Workflow does not contain permissions #20
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.
Potential fix for https://github.com/DevCycleHQ/assemblyscript-regex/security/code-scanning/1
To fix the problem, you should add a
permissionsblock to the workflow or to each job. Since CodeQL suggests starting withcontents: read, and because the workflow runs steps related to releases that may require additional write permissions (such as creating releases or pushing tags), be as restrictive as possible but allow necessary function. The single best way to fix is to add to thereleasejob (line 12), immediately beforeruns-on, the following block:If more granular permissions are required (e.g., writing to releases or pull requests), you may add those. However, based on common releases via semantic-release and minimal starting point,
contents: writeis likely sufficient..github/workflows/release.ymlin the jobrelease(line 12), inserting thepermissionsblock after the job name and beforeruns-on.Suggested fixes powered by Copilot Autofix. Review carefully before merging.