From 401462ee6c1ee6baddc24eaac9491daf786b00a8 Mon Sep 17 00:00:00 2001 From: Aleksey Kulikov Date: Sun, 4 Feb 2024 11:39:35 +0100 Subject: [PATCH] fix uploadArtifact --- src/index.js | 4 ++-- src/utils/artifacts.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/index.js b/src/index.js index 90a9c7301..e109910e0 100644 --- a/src/index.js +++ b/src/index.js @@ -76,7 +76,7 @@ async function main() { '--target=lhci', `--serverBaseUrl=${input.serverBaseUrl}`, `--token=${input.serverToken}`, - '--ignoreDuplicateBuildFailure' // ignore failure on the same commit rerun + '--ignoreDuplicateBuildFailure', // ignore failure on the same commit rerun ) } else if (input.temporaryPublicStorage) { uploadParams.push('--target=temporary-public-storage') @@ -85,7 +85,7 @@ async function main() { if (input.basicAuthPassword) { uploadParams.push( `--basicAuth.username=${input.basicAuthUsername}`, - `--basicAuth.password=${input.basicAuthPassword}` + `--basicAuth.password=${input.basicAuthPassword}`, ) } diff --git a/src/utils/artifacts.js b/src/utils/artifacts.js index ba0364d6b..993f9748e 100644 --- a/src/utils/artifacts.js +++ b/src/utils/artifacts.js @@ -1,11 +1,11 @@ -const artifact = require('@actions/artifact') +const { DefaultArtifactClient } = require('@actions/artifact') const fs = require('fs').promises const { join } = require('path') /** @param {string} resultsPath */ exports.uploadArtifacts = async function uploadArtifacts(resultsPath, artifactName = 'lighthouse-results') { - const artifactClient = artifact.create() + const artifactClient = new DefaultArtifactClient() const fileNames = await fs.readdir(resultsPath) const files = fileNames.map((fileName) => join(resultsPath, fileName)) - return artifactClient.uploadArtifact(artifactName, files, resultsPath, { continueOnError: true }) + return artifactClient.uploadArtifact(artifactName, files, resultsPath) }