Skip to content

Fix four code-scanning alerts - #261

Merged
aleks-pro merged 5 commits into
masterfrom
aleks-pro-fix-code-scanning-alerts
Nov 3, 2026
Merged

aleks-pro merged 5 commits into
masterfrom
aleks-pro-fix-code-scanning-alerts

Conversation

@aleks-pro

@aleks-pro aleks-pro commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Address the four open code-scanning alerts in separate commits:

Alert Commit Fix
#4 685aace Deny workflow token permissions by default; grant the stale job only issues: write and pull-requests: write. Preserve the keepalive job's existing contents: write permission.
#5 757719c Deny workflow token permissions by default; grant the label job contents: read, issues: write, and pull-requests: write, matching the underlying label action's documented requirements for the configured events.
#6 bb3b12d Remove the unused check-security-alerts.yml workflow.
#7 01ee0bb Replace shell-interpolated npm pack and npm publish commands with executable/argument arrays using the existing execa dependency, which handles Windows command shims. Preserve literal publish arguments and existing tarball permission repair.

The packaging change is defensive hardening; exploitability of the original path-derived command was not established. No dependency upgrades or unrelated audit fixes are included.

Follow-up commit 4d507dc removes test/tests/publish-test.js at the user's request; the packaging fix is unchanged.

Validation

  • After removing the publish tests, npm test passed locally on Windows with Node 24: lint, TypeScript build, and all 9 remaining tests.
  • Before test removal, both CI test jobs passed on Ubuntu and Windows, and CodeQL Actions and JavaScript analyses passed with no open alerts for refs/pull/261/merge. CI will rerun for the follow-up commit.
  • Before their removal, the publish tests successfully exercised real npm pack against paths containing spaces, ampersands, and semicolons, argument boundaries, tarball executable-bit repair, and pack error propagation. No package was published. These tests are no longer part of the PR.
  • Parsed both modified workflows as YAML and asserted their exact default/job permission scopes and removal of the unused workflow.
  • git diff --check passed.

Limitations

Workflow actions were not run against live issues or pull requests to avoid modifying repository state. Alerts on the default branch will not close until the changes are merged and rescanned.

aleks-pro and others added 4 commits November 2, 2026 17:27
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Use execa argument arrays for pack and publish, preserving Windows command-shim support and literal argument boundaries. Cover special-character paths, tarball executable permissions, and packaging errors.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues block approval of the workflow-permission and package-publishing hardening changes.

No open issues 🎉

What changed in this PR

This PR addresses four code-scanning alerts by tightening workflow permissions, removing an unused workflow, and hardening the package publishing task.

Changes:

  • Deny workflow token permissions by default and grant only the required job-level permissions.
  • Remove the unused security-alert workflow.
  • Replace shell-interpolated npm commands with executable/argument arrays, with regression tests for argument handling, special-character paths, permission repair, and pack failures.
File Description
test/​tests/​publish-test.js Adds regression tests for packaging and publishing behavior.
Gulpfile.js Passes npm arguments separately instead of interpolating shell commands.
.github/​workflows/​handle-stale.yml Restricts default permissions and grants stale-job write access.
.github/​workflows/​handle-labels.yml Restricts default permissions and explicitly scopes label-job access.
.github/​workflows/​check-security-alerts.yml Removes the unused security-alert workflow.

Review effort: Balanced

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

There are no active review issues for the workflow-permission and package-publishing hardening changes.

No open issues 🎉

Review effort: Balanced

@aleks-pro
aleks-pro merged commit 3fb19a3 into master Nov 3, 2026
6 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.

3 participants