From 821cbcc3495148a63f3fac5f9807bc94dc397332 Mon Sep 17 00:00:00 2001 From: Nick Cipollo Date: Sun, 3 Oct 2021 17:21:27 -0400 Subject: [PATCH] Bump typescript, fix build errors around catch blocks. --- lib/Artifact.js | 6 +++--- lib/ArtifactGlobber.js | 2 +- lib/ArtifactPathValidator.js | 2 +- lib/Inputs.js | 2 +- src/Action.ts | 2 +- src/ArtifactUploader.ts | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/Artifact.js b/lib/Artifact.js index 23a90fd..61c429d 100644 --- a/lib/Artifact.js +++ b/lib/Artifact.js @@ -6,14 +6,14 @@ const fs_1 = require("fs"); class Artifact { constructor(path, contentType = "raw") { this.path = path; - this.name = path_1.basename(path); + this.name = (0, path_1.basename)(path); this.contentType = contentType; } get contentLength() { - return fs_1.statSync(this.path).size; + return (0, fs_1.statSync)(this.path).size; } readFile() { - return fs_1.readFileSync(this.path); + return (0, fs_1.readFileSync)(this.path); } } exports.Artifact = Artifact; diff --git a/lib/ArtifactGlobber.js b/lib/ArtifactGlobber.js index 685cdc7..998d85b 100644 --- a/lib/ArtifactGlobber.js +++ b/lib/ArtifactGlobber.js @@ -63,7 +63,7 @@ class FileArtifactGlobber { throw Error(`Artifact pattern :${pattern} did not match any files`); } static expandPath(path) { - return untildify_1.default(path); + return (0, untildify_1.default)(path); } } exports.FileArtifactGlobber = FileArtifactGlobber; diff --git a/lib/ArtifactPathValidator.js b/lib/ArtifactPathValidator.js index 664396a..98d5ffd 100644 --- a/lib/ArtifactPathValidator.js +++ b/lib/ArtifactPathValidator.js @@ -39,7 +39,7 @@ class ArtifactPathValidator { } } verifyNotDirectory(path) { - const isDir = fs_1.statSync(path).isDirectory(); + const isDir = (0, fs_1.statSync)(path).isDirectory(); if (isDir) { const message = `Artifact is a directory:${path}. Directories can not be uploaded to a release.`; this.reportError(message); diff --git a/lib/Inputs.js b/lib/Inputs.js index 56e642f..b527c01 100644 --- a/lib/Inputs.js +++ b/lib/Inputs.js @@ -164,7 +164,7 @@ class CoreInputs { return core.getInput('omitNameDuringUpdate') == 'true'; } stringFromFile(path) { - return fs_1.readFileSync(path, 'utf-8'); + return (0, fs_1.readFileSync)(path, 'utf-8'); } } exports.CoreInputs = CoreInputs; diff --git a/src/Action.ts b/src/Action.ts index 34dadb0..460cdf7 100644 --- a/src/Action.ts +++ b/src/Action.ts @@ -42,7 +42,7 @@ export class Action { let getResponse: ReleaseByTagResponse try { getResponse = await this.releases.getByTag(this.inputs.tag) - } catch (error) { + } catch (error: any) { return await this.checkForMissingReleaseError(error) } diff --git a/src/ArtifactUploader.ts b/src/ArtifactUploader.ts index 41b5939..4a50f6a 100644 --- a/src/ArtifactUploader.ts +++ b/src/ArtifactUploader.ts @@ -41,7 +41,7 @@ export class GithubArtifactUploader implements ArtifactUploader { artifact.readFile(), artifact.name, releaseId) - } catch (error) { + } catch (error: any) { if (error.status >= 500 && retry > 0) { core.warning(`Failed to upload artifact ${artifact.name}. ${error.message}. Retrying...`) await this.uploadArtifact(artifact, releaseId, uploadUrl, retry - 1)