@@ -523,6 +523,21 @@ describe('WorkspaceContext with optional directories', () => {
523523 }
524524 } ) ;
525525
526+ it ( 'should reject GitHub Actions Workload Identity credentials' , ( ) => {
527+ const workspaceContext = new WorkspaceContext ( cwd ) ;
528+
529+ const sensitivePaths = [
530+ path . join ( cwd , 'gha-creds-12345.json' ) ,
531+ path . join ( cwd , 'gha-creds-abcde.json' ) ,
532+ path . join ( cwd , 'GHA-CREDS-abcde.JSON' ) , // Case-insensitivity check
533+ path . join ( cwd , 'subfolder' , 'gha-creds-12345.json' ) , // Nested
534+ ] ;
535+
536+ for ( const p of sensitivePaths ) {
537+ expect ( workspaceContext . isPathWithinWorkspace ( p ) ) . toBe ( false ) ;
538+ }
539+ } ) ;
540+
526541 it ( 'should allow standard non-sensitive paths' , ( ) => {
527542 const workspaceContext = new WorkspaceContext ( cwd ) ;
528543
@@ -531,6 +546,8 @@ describe('WorkspaceContext with optional directories', () => {
531546 path . join ( cwd , '.gitignore' ) ,
532547 path . join ( cwd , '.env.example' ) ,
533548 path . join ( cwd , 'package.json' ) ,
549+ path . join ( cwd , 'tsconfig.json' ) ,
550+ path . join ( cwd , 'gha-creds.json' ) , // Doesn't match the pattern
534551 ] ;
535552
536553 for ( const p of safePaths ) {
0 commit comments