diff --git a/src/index.ts b/src/index.ts index 51a0d38..537875b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,15 +1,17 @@ -import core from "@actions/core"; +import { getInput, setFailed } from "@actions/core"; import puppeteer from "puppeteer"; import { wait } from "./utils/wait"; async function run(): Promise { - const browser = await puppeteer.launch(); + const browser = await puppeteer.launch({ + headless: "new", + }); - const waitMsInput = core.getInput("wait-on-start"); + const waitMsInput = getInput("wait-on-start"); const waitMs = waitMsInput ? parseInt(waitMsInput) : 0; - const url = core.getInput("target-url", { required: true }); - const selector = core.getInput("target-selector", { required: true }); + const url = getInput("target-url", { required: true }); + const selector = getInput("target-selector", { required: true }); await wait(waitMs); @@ -20,7 +22,7 @@ async function run(): Promise { console.log("Smoke test succeeded"); } catch (error) { console.log(error); - core.setFailed("Smoke test failed"); + setFailed("Smoke test failed"); } await browser.close();