Fixes #1 Allow for multiple artifacts
This commit is contained in:
@@ -9,26 +9,25 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const core = __importStar(require("@actions/core"));
|
||||
const fs_1 = require("fs");
|
||||
const path_1 = require("path");
|
||||
class CoreInputs {
|
||||
constructor(context) {
|
||||
constructor(artifactGlobber, context) {
|
||||
this.artifactGlobber = artifactGlobber;
|
||||
this.context = context;
|
||||
}
|
||||
get artifact() {
|
||||
return core.getInput('artifact');
|
||||
}
|
||||
get artifactName() {
|
||||
return path_1.basename(this.artifact);
|
||||
}
|
||||
get artifactContentType() {
|
||||
const type = core.getInput('artifactContentType');
|
||||
if (type) {
|
||||
return type;
|
||||
get artifacts() {
|
||||
let artifacts = core.getInput('artifacts');
|
||||
if (!artifacts) {
|
||||
artifacts = core.getInput('artifacts');
|
||||
}
|
||||
return 'raw';
|
||||
}
|
||||
get artifactContentLength() {
|
||||
return fs_1.statSync(this.artifact).size;
|
||||
if (artifacts) {
|
||||
let contentType = core.getInput('artifactContentType');
|
||||
if (!contentType) {
|
||||
contentType = 'raw';
|
||||
}
|
||||
return this.artifactGlobber
|
||||
.globArtifactString(artifacts, contentType);
|
||||
}
|
||||
return [];
|
||||
}
|
||||
get body() {
|
||||
const body = core.getInput('body');
|
||||
@@ -70,9 +69,6 @@ class CoreInputs {
|
||||
get token() {
|
||||
return core.getInput('token', { required: true });
|
||||
}
|
||||
readArtifact() {
|
||||
return fs_1.readFileSync(this.artifact);
|
||||
}
|
||||
stringFromFile(path) {
|
||||
return fs_1.readFileSync(path, 'utf-8');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user