Address Code Scanning alerts#38
Merged
Merged
Conversation
- ci.yml: add least-privilege permissions block (contents: read) - ci.yml/deploy.yml: pin pnpm/action-setup to commit SHA - fetch-definitions.js: suppress js/http-to-file-access (OUTPUT_PATH is hardcoded)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Addresses all 4 open Code Scanning alerts.
Changes
Alert #1 —
actions/missing-workflow-permissions(ci.yml)Added an explicit least-privilege permissions block at the workflow level:
The CI workflow only checks out code, builds, and uploads an artifact — no repo write access needed.
deploy.ymlalready had a correct permissions block, so it wasn't flagged.Alerts #2 & #3 —
actions/unpinned-tag(ci.yml,deploy.yml)Pinned
pnpm/action-setup@v4to its commit SHAb906affcce14559ad1aafd4ab0e942779e9f58b1in both workflows, with a trailing# v4comment so Dependabot continues to track the v4 line and can update both the SHA and comment in lockstep.Alert #4 —
js/http-to-file-access(scripts/fetch-definitions.js)Added an
lgtm[js/http-to-file-access]suppression comment with justification. The rule's underlying concern (HTTP response controlling the write path) does not apply here —OUTPUT_PATHis hardcoded viaimport.meta.url, and the HTTP response only controls file contents, never file location. The default URL is a hardcodedsecondlife/lsl-definitionsraw URL, and the content is parsed downstream as YAML data, not executed.Notes
pnpm/action-setupis currently at v6.0.8; Dependabot will likely propose a major bump shortly after Enable Dependabot for npm and GitHub Actions #28 merges. Handling that as a separate PR is recommended since v5/v6 changed how the pnpm version is resolved.