Bump typescript, fix build errors around catch blocks.
This commit is contained in:
@@ -6,14 +6,14 @@ const fs_1 = require("fs");
|
|||||||
class Artifact {
|
class Artifact {
|
||||||
constructor(path, contentType = "raw") {
|
constructor(path, contentType = "raw") {
|
||||||
this.path = path;
|
this.path = path;
|
||||||
this.name = path_1.basename(path);
|
this.name = (0, path_1.basename)(path);
|
||||||
this.contentType = contentType;
|
this.contentType = contentType;
|
||||||
}
|
}
|
||||||
get contentLength() {
|
get contentLength() {
|
||||||
return fs_1.statSync(this.path).size;
|
return (0, fs_1.statSync)(this.path).size;
|
||||||
}
|
}
|
||||||
readFile() {
|
readFile() {
|
||||||
return fs_1.readFileSync(this.path);
|
return (0, fs_1.readFileSync)(this.path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.Artifact = Artifact;
|
exports.Artifact = Artifact;
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ class FileArtifactGlobber {
|
|||||||
throw Error(`Artifact pattern :${pattern} did not match any files`);
|
throw Error(`Artifact pattern :${pattern} did not match any files`);
|
||||||
}
|
}
|
||||||
static expandPath(path) {
|
static expandPath(path) {
|
||||||
return untildify_1.default(path);
|
return (0, untildify_1.default)(path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.FileArtifactGlobber = FileArtifactGlobber;
|
exports.FileArtifactGlobber = FileArtifactGlobber;
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ class ArtifactPathValidator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
verifyNotDirectory(path) {
|
verifyNotDirectory(path) {
|
||||||
const isDir = fs_1.statSync(path).isDirectory();
|
const isDir = (0, fs_1.statSync)(path).isDirectory();
|
||||||
if (isDir) {
|
if (isDir) {
|
||||||
const message = `Artifact is a directory:${path}. Directories can not be uploaded to a release.`;
|
const message = `Artifact is a directory:${path}. Directories can not be uploaded to a release.`;
|
||||||
this.reportError(message);
|
this.reportError(message);
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ class CoreInputs {
|
|||||||
return core.getInput('omitNameDuringUpdate') == 'true';
|
return core.getInput('omitNameDuringUpdate') == 'true';
|
||||||
}
|
}
|
||||||
stringFromFile(path) {
|
stringFromFile(path) {
|
||||||
return fs_1.readFileSync(path, 'utf-8');
|
return (0, fs_1.readFileSync)(path, 'utf-8');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.CoreInputs = CoreInputs;
|
exports.CoreInputs = CoreInputs;
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ export class Action {
|
|||||||
let getResponse: ReleaseByTagResponse
|
let getResponse: ReleaseByTagResponse
|
||||||
try {
|
try {
|
||||||
getResponse = await this.releases.getByTag(this.inputs.tag)
|
getResponse = await this.releases.getByTag(this.inputs.tag)
|
||||||
} catch (error) {
|
} catch (error: any) {
|
||||||
return await this.checkForMissingReleaseError(error)
|
return await this.checkForMissingReleaseError(error)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ export class GithubArtifactUploader implements ArtifactUploader {
|
|||||||
artifact.readFile(),
|
artifact.readFile(),
|
||||||
artifact.name,
|
artifact.name,
|
||||||
releaseId)
|
releaseId)
|
||||||
} catch (error) {
|
} catch (error: any) {
|
||||||
if (error.status >= 500 && retry > 0) {
|
if (error.status >= 500 && retry > 0) {
|
||||||
core.warning(`Failed to upload artifact ${artifact.name}. ${error.message}. Retrying...`)
|
core.warning(`Failed to upload artifact ${artifact.name}. ${error.message}. Retrying...`)
|
||||||
await this.uploadArtifact(artifact, releaseId, uploadUrl, retry - 1)
|
await this.uploadArtifact(artifact, releaseId, uploadUrl, retry - 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user