Fix things

This commit is contained in:
Nick Cipollo
2019-08-27 14:04:26 -04:00
parent 2b2c872297
commit ab829dde02
2 changed files with 9 additions and 7 deletions

View File

@@ -8,8 +8,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const path_1 = require("path");
const fs_1 = require("fs");
class Action {
constructor(inputs, releases) {
this.inputs = inputs;
@@ -19,13 +17,10 @@ class Action {
return __awaiter(this, void 0, void 0, function* () {
const createResult = yield this.releases.create(this.inputs.tag, this.inputs.body, this.inputs.commit, this.inputs.draft, this.inputs.name);
if (this.inputs.artifact) {
const artifactData = this.readArtifact(this.inputs.artifact);
yield this.releases.uploadArtifact(createResult.data.upload_url, this.inputs.artifactContentLength, this.inputs.artifactContentType, artifactData, path_1.basename(this.inputs.artifact));
const artifactData = this.inputs.readArtifact();
yield this.releases.uploadArtifact(createResult.data.upload_url, this.inputs.artifactContentLength, this.inputs.artifactContentType, artifactData, this.inputs.artifactName);
}
});
}
readArtifact(path) {
return fs_1.readFileSync(path);
}
}
exports.Action = Action;