11import type { AuthContextOutput } from "./types.d.js" ;
2- import crypto from "node:crypto" ;
32import process from "node:process" ;
4- import * as url from "node:url" ;
53import core from "@actions/core" ;
64import playwright from "playwright" ;
75
@@ -18,13 +16,6 @@ export default async function () {
1816 const password = core . getInput ( "password" , { required : true } ) ;
1917 core . setSecret ( password ) ;
2018
21- // Determine storage path for authenticated session state
22- // Playwright will create missing directories, if needed
23- const actionDirectory = `${ url . fileURLToPath ( new URL ( import . meta. url ) ) } /..` ;
24- const sessionStatePath = `${
25- process . env . RUNNER_TEMP ?? actionDirectory
26- } /.auth/${ crypto . randomUUID ( ) } /sessionState.json`;
27-
2819 // Launch a headless browser
2920 browser = await playwright . chromium . launch ( {
3021 headless : true ,
@@ -76,13 +67,19 @@ export default async function () {
7667 username,
7768 password,
7869 cookies,
79- localStorage : origins . reduce ( ( acc , { origin, localStorage } ) => {
80- acc [ origin ] = localStorage . reduce ( ( acc , { name, value } ) => {
81- acc [ name ] = value ;
70+ localStorage : origins . reduce (
71+ ( acc , { origin, localStorage } ) => {
72+ acc [ origin ] = localStorage . reduce (
73+ ( acc , { name, value } ) => {
74+ acc [ name ] = value ;
75+ return acc ;
76+ } ,
77+ { } as Record < string , string > ,
78+ ) ;
8279 return acc ;
83- } , { } as Record < string , string > ) ;
84- return acc ;
85- } , { } as Record < string , Record < string , string > > ) ,
80+ } ,
81+ { } as Record < string , Record < string , string > > ,
82+ ) ,
8683 } ;
8784 core . setOutput ( "auth_context" , JSON . stringify ( authContextOutput ) ) ;
8885 core . debug ( "Output: 'auth_context'" ) ;
0 commit comments