Skip to content

Potential fix for code scanning alert no. 2: Workflow does not contain permissions#19

Merged
syyyr merged 1 commit into
mainfrom
alert-autofix-2
Mar 16, 2026
Merged

Potential fix for code scanning alert no. 2: Workflow does not contain permissions#19
syyyr merged 1 commit into
mainfrom
alert-autofix-2

Conversation

@syyyr
Copy link
Copy Markdown
Contributor

@syyyr syyyr commented Mar 16, 2026

Potential fix for https://github.com/silicon-heaven/vue-shv/security/code-scanning/2

To fix this, explicitly set permissions for the workflow so the GITHUB_TOKEN is restricted to the minimal scope needed. This workflow only checks out code and runs npm install / npm run commands; it does not push commits, create releases, or modify issues/PRs. Therefore, contents: read is sufficient. Defining permissions at the root of the workflow applies to all jobs that don’t override it, covering both type-check and xo without changing their behavior.

The single best fix is to add a top-level permissions: block (at the same indentation level as name, on, and jobs) specifying contents: read. A natural place is right after the name: Lint line (line 2) and before concurrency: so that it’s clearly visible and applies globally. No imports or additional methods are needed; this is purely a YAML configuration change within .github/workflows/lint.yml.

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

@syyyr syyyr marked this pull request as ready for review March 16, 2026 15:49
…n permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@syyyr syyyr force-pushed the alert-autofix-2 branch from 908d142 to 8d02b24 Compare March 16, 2026 15:50
@syyyr syyyr enabled auto-merge March 16, 2026 15:50
@syyyr syyyr merged commit bbe7d45 into main Mar 16, 2026
5 checks passed
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