Skip to content

Npm plugin loading#242

Open
kzhou314 wants to merge 4 commits into
mainfrom
npm-plugin-loading
Open

Npm plugin loading#242
kzhou314 wants to merge 4 commits into
mainfrom
npm-plugin-loading

Conversation

@kzhou314

Copy link
Copy Markdown
Contributor

Scanner-side fixes for https://github.com/github/accessibility/issues/10755.
Consumers request a first-party NPM plugin by passing an object in the scans input:

scans: |
  ["axe", {"name": "alt-text-scan", "package": "@github/accessibility-scanner-alt-text-plugin", "version": "1.0.0"}]

kzhou314 added 2 commits June 25, 2026 15:20
Accept object entries in the 'scans' input ({name, package, version}) and install/import them at runtime via npm install --ignore-scripts. Loading is gated to first-party allowlist. Includes unit tests.
GitHub Advanced Security started work on behalf of kzhou314 June 25, 2026 22:23 View session
GitHub Advanced Security finished work on behalf of kzhou314 June 25, 2026 22:23
@kzhou314 kzhou314 marked this pull request as ready for review June 25, 2026 22:24
@kzhou314 kzhou314 requested a review from a team as a code owner June 25, 2026 22:24

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.

Pull request overview

This PR adds support for installing and loading curated first-party accessibility scanner plugins from NPM, driven by object entries in the scans input (alongside existing built-in and local plugins). This addresses consumers who want to use a first-party plugin without vendoring plugin source into their repo.

Changes:

  • Extend scans input parsing to accept {name, package, version?} entries and forward requested NPM plugins into plugin loading.
  • Add an NPM plugin loader that installs packages at runtime and dynamically imports them.
  • Document the new NPM plugin mechanism and update the action input description; add unit tests for the NPM loader and NPM-plugin loading path.
Show a summary per file
File Description
PLUGINS.md Documents how to request and load first-party NPM-published plugins via scans.
.github/actions/find/action.yml Expands scans input description to include object-form entries for NPM plugins.
.github/actions/find/src/scansContextProvider.ts Parses scans entries into scan names + a list of requested NPM plugins.
.github/actions/find/src/pluginManager/types.ts Introduces NpmPluginRequest type for NPM plugin requests.
.github/actions/find/src/pluginManager/npmPluginLoader.ts Adds runtime npm install + dynamic import for NPM plugin modules.
.github/actions/find/src/pluginManager/index.ts Loads curated first-party NPM plugins after built-in and local plugins, with validation/precedence rules.
.github/actions/find/src/findForUrl.ts Passes parsed npmPlugins into plugin loading so NPM plugins can be installed/loaded for the scan run.
.github/actions/find/tests/npmPluginLoader.test.ts Adds unit tests for NPM install flags and NPM plugin loading/skip behavior.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 8/8 changed files
  • Comments generated: 5

Comment thread .github/actions/find/src/scansContextProvider.ts
Comment thread .github/actions/find/src/pluginManager/npmPluginLoader.ts
Comment thread .github/actions/find/src/pluginManager/npmPluginLoader.ts
Comment thread .github/actions/find/src/pluginManager/index.ts
Comment thread .github/actions/find/src/findForUrl.ts
GitHub Advanced Security started work on behalf of kzhou314 June 26, 2026 18:36 View session
GitHub Advanced Security finished work on behalf of kzhou314 June 26, 2026 18:37
GitHub Advanced Security started work on behalf of kzhou314 June 26, 2026 19:11 View session
GitHub Advanced Security finished work on behalf of kzhou314 June 26, 2026 19:12
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.

2 participants