Fix things
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user