Skip to content

Commit

Permalink
Bump typescript, fix build errors around catch blocks.
Browse files Browse the repository at this point in the history
  • Loading branch information
ncipollo committed Oct 3, 2021
1 parent 4531373 commit 821cbcc
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions lib/Artifact.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
2 changes: 1 addition & 1 deletion lib/ArtifactGlobber.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
2 changes: 1 addition & 1 deletion lib/ArtifactPathValidator.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion lib/Inputs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
2 changes: 1 addition & 1 deletion src/Action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
2 changes: 1 addition & 1 deletion src/ArtifactUploader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 821cbcc

Please sign in to comment.