@@ -61,8 +61,20 @@ export async function loadBuiltInPlugins() {
6161// exported for mocking/testing. not for actual use
6262export async function loadCustomPlugins ( ) {
6363 core . info ( 'Loading custom plugins' )
64+ const pluginsPath = path . join ( process . cwd ( ) , '.github/scanner-plugins/' )
65+
66+ // - currently, the plugin manager will abort loading
67+ // all plugins if there's an error
68+ // - the problem with this is that if a scanner user doesnt
69+ // have custom plugins, they won't have a 'scanner-plugins' folder
70+ // which will cause an error and abort loading all plugins, including built-in ones
71+ // - so for custom plugins, if the path doesn't exist, we can return early
72+ // and not abort the loading of built-in plugins
73+ if ( ! fs . existsSync ( pluginsPath ) ) {
74+ core . info ( 'No custom plugins found.' )
75+ return
76+ }
6477
65- const pluginsPath = path . join ( process . cwd ( ) , '/.github/scanner-plugins/' )
6678 await loadPluginsFromPath ( { pluginsPath} )
6779}
6880
@@ -75,7 +87,7 @@ export async function loadPluginsFromPath({pluginsPath}: {pluginsPath: string})
7587
7688 if ( fs . existsSync ( pluginFolderPath ) && fs . lstatSync ( pluginFolderPath ) . isDirectory ( ) ) {
7789 core . info ( `Found plugin: ${ pluginFolder } ` )
78- plugins . push ( await dynamicImport ( path . join ( pluginsPath , pluginFolder , '/ index.js' ) ) )
90+ plugins . push ( await dynamicImport ( path . join ( pluginsPath , pluginFolder , 'index.js' ) ) )
7991 }
8092 }
8193 } catch ( e ) {
0 commit comments