Fixes #1 Allow for multiple artifacts
This commit is contained in:
@@ -9,16 +9,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
class Action {
|
||||
constructor(inputs, releases) {
|
||||
constructor(inputs, releases, uploader) {
|
||||
this.inputs = inputs;
|
||||
this.releases = releases;
|
||||
this.uploader = uploader;
|
||||
}
|
||||
perform() {
|
||||
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.inputs.readArtifact();
|
||||
yield this.releases.uploadArtifact(createResult.data.upload_url, this.inputs.artifactContentLength, this.inputs.artifactContentType, artifactData, this.inputs.artifactName);
|
||||
const artifacts = this.inputs.artifacts;
|
||||
if (artifacts.length > 0) {
|
||||
yield this.uploader.uploadArtifacts(artifacts, createResult.data.upload_url);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user