From eae709c29ee5b0720a29b3ba8413441889012d91 Mon Sep 17 00:00:00 2001 From: Sergey Dolin Date: Thu, 22 Jun 2023 14:04:14 +0200 Subject: [PATCH] fix artifact --- dist/index.js | 29 ++++++++++++++++++++++++++--- src/classes/state.ts | 2 +- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/dist/index.js b/dist/index.js index 0f6c58a3..23f10cda 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1518,6 +1518,29 @@ exports.StaleOperations = StaleOperations; "use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { @@ -1536,7 +1559,7 @@ const os_1 = __importDefault(__nccwpck_require__(2037)); const crypto_1 = __importDefault(__nccwpck_require__(6113)); const fs_1 = __importDefault(__nccwpck_require__(7147)); const path_1 = __importDefault(__nccwpck_require__(1017)); -const artifact_1 = __importDefault(__nccwpck_require__(2605)); +const artifact = __importStar(__nccwpck_require__(2605)); class State { constructor() { this.processedIssuesIDs = new Set(); @@ -1556,7 +1579,7 @@ class State { const tmpDir = os_1.default.tmpdir(); const file = crypto_1.default.randomBytes(8).readBigUInt64LE(0).toString(); fs_1.default.writeFileSync(path_1.default.join(tmpDir, file), serialized); - const artifactClient = artifact_1.default.create(); + const artifactClient = artifact.create(); // TODO: handle errors yield artifactClient.uploadArtifact(State.ARTIFACT_NAME, [file], tmpDir); }); @@ -1565,7 +1588,7 @@ class State { return __awaiter(this, void 0, void 0, function* () { this.reset(); const tmpDir = os_1.default.tmpdir(); - const artifactClient = artifact_1.default.create(); + const artifactClient = artifact.create(); const downloadResponse = yield artifactClient.downloadArtifact(State.ARTIFACT_NAME, tmpDir); const downloadedFiles = fs_1.default.readdirSync(downloadResponse.downloadPath); if (downloadedFiles.length === 0) { diff --git a/src/classes/state.ts b/src/classes/state.ts index 0a6ba966..326189a9 100644 --- a/src/classes/state.ts +++ b/src/classes/state.ts @@ -4,7 +4,7 @@ import os from 'os'; import crypto from 'crypto'; import fs from 'fs'; import path from 'path'; -import artifact from '@actions/artifact'; +import * as artifact from '@actions/artifact'; type IssueID = number; export class State implements IState {