Remove unused variable in changeset test (CodeQL alert #496)#22772
Merged
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> Agent-Logs-Url: https://github.com/github/gh-aw/sessions/605f9b59-7462-4bed-b499-00caa842f1e2
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> Agent-Logs-Url: https://github.com/github/gh-aw/sessions/605f9b59-7462-4bed-b499-00caa842f1e2
Copilot
AI
changed the title
[WIP] Fix code scanning alert 496
Remove unused variable in changeset test (CodeQL alert #496)
Mar 24, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Removes a CodeQL-reported unused local variable from the changeset script test harness to eliminate dead code and stale commentary.
Changes:
- Removed an unused
require()assignment (changesetModule) that was never referenced. - Deleted outdated comments describing an unimplemented test approach, keeping the manual-testing note.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
182
to
185
| // Test 6: No changesets with explicit release type (simulate updateChangelog) | ||
| console.log("\n=== Test 6: CHANGELOG entry for release without changesets ==="); | ||
| // We'll test the updateChangelog function directly by requiring the module | ||
| const changesetModule = require(CHANGESET_SCRIPT); | ||
| // Since we can't easily access internal functions, we'll just verify the version command works | ||
| // The actual changelog update behavior will be tested manually | ||
|
|
There was a problem hiding this comment.
The "Test 6" block no longer performs any checks (it only logs a header and then proceeds to results). Consider either removing the Test 6 header entirely, or adding a small automated assertion that exercises the intended behavior, and keep the manual-testing note as a fallback.
See below for a potential fix:
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.
CodeQL flagged an unused local variable
changesetModuleinscripts/changeset.test.js— arequire()result assigned but never referenced, left over from an unfinished test stub.Changes
scripts/changeset.test.js: Remove the dead assignmentconst changesetModule = require(CHANGESET_SCRIPT)and its stale comments describing the unimplemented test approach; retain the single comment describing the manual testing intent.⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.