support multi-line delimited assets. fixes #15

This commit is contained in:
softprops 2019-09-17 23:14:30 +09:00
parent a6281eb824
commit 3af8783d41
4 changed files with 80 additions and 5 deletions

View file

@ -9,6 +9,12 @@ var __importStar = (this && this.__importStar) || function (mod) {
Object.defineProperty(exports, "__esModule", { value: true });
const glob = __importStar(require("glob"));
const fs_1 = require("fs");
exports.parseInputFiles = (files) => {
return files.split(/\r?\n/).reduce((acc, line) => acc
.concat(line.split(","))
.filter(pat => pat)
.map(pat => pat.trim()), []);
};
exports.parseConfig = (env) => {
return {
github_token: env.GITHUB_TOKEN || "",
@ -17,7 +23,7 @@ exports.parseConfig = (env) => {
input_name: env.INPUT_NAME,
input_body: env.INPUT_BODY,
input_body_path: env.INPUT_BODY_PATH,
input_files: (env.INPUT_FILES || "").split(","),
input_files: exports.parseInputFiles(env.INPUT_FILES || ""),
input_draft: env.INPUT_DRAFT === "true"
};
};