From f8d77f68742b314fe23e8d385879cda6fb0aa3c5 Mon Sep 17 00:00:00 2001 From: Gabriel Cousin <7649529+GabrielCousin@users.noreply.github.com> Date: Thu, 3 Aug 2023 21:00:45 +0200 Subject: [PATCH] fix(action): deprecations --- src/index.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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();