File tree Expand file tree Collapse file tree 4 files changed +13
-4
lines changed
Expand file tree Collapse file tree 4 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,10 @@ https://primer.style
1515https://primer.style/octicons/
1616```
1717
18+ #### ` session_state_path `
19+
20+ ** Optional** Path to a file containing authenticated session state.
21+
1822### Outputs
1923
2024#### ` findings `
Original file line number Diff line number Diff line change 66 description : " Newline-delimited list of URLs to check for accessibility issues"
77 required : true
88 multiline : true
9+ session_state_path :
10+ description : " Path to a file containing authenticated session state"
11+ required : false
912
1013outputs :
1114 findings :
Original file line number Diff line number Diff line change @@ -2,12 +2,12 @@ import type { Finding } from './types.d.js';
22import AxeBuilder from '@axe-core/playwright'
33import playwright from 'playwright' ;
44
5- export async function findForUrl ( url : string ) : Promise < Finding [ ] > {
5+ export async function findForUrl ( url : string , sessionStatePath ?: string ) : Promise < Finding [ ] > {
66 const browser = await playwright . chromium . launch ( { headless : true , executablePath : process . env . CI ? '/usr/bin/google-chrome' : undefined } ) ;
7- const context = await browser . newContext ( ) ;
7+ const context = await browser . newContext ( { storageState : sessionStatePath } ) ;
88 const page = await context . newPage ( ) ;
99 await page . goto ( url ) ;
10-
10+
1111 let findings : Finding [ ] = [ ] ;
1212 try {
1313 const rawFindings = await new AxeBuilder ( { page } ) . analyze ( ) ;
Original file line number Diff line number Diff line change @@ -5,11 +5,13 @@ export default async function () {
55 core . info ( "Starting 'find' action" ) ;
66 const urls = core . getMultilineInput ( 'urls' , { required : true } ) ;
77 core . debug ( `Input: 'urls: ${ JSON . stringify ( urls ) } '` ) ;
8+ const sessionStatePath = core . getInput ( 'session_state_path' , { required : false } ) ;
9+ core . debug ( `Input: 'session_state_path: ${ sessionStatePath } '` ) ;
810
911 let findings = [ ] ;
1012 for ( const url of urls ) {
1113 core . info ( `Scanning ${ url } ` )
12- const findingsForUrl = await findForUrl ( url ) ;
14+ const findingsForUrl = await findForUrl ( url , sessionStatePath ) ;
1315 if ( findingsForUrl . length === 0 ) {
1416 core . info ( `No accessibility gaps were found on ${ url } ` ) ;
1517 continue ;
You can’t perform that action at this time.
0 commit comments