Add dynamic indexes

This commit is contained in:
linguist
2020-12-30 12:33:53 +01:00
parent 43875d9d7d
commit a8fe11b7b5
11 changed files with 51 additions and 147 deletions

View File

@@ -2,9 +2,10 @@
const processes = require("child_process")
const yaml = require("js-yaml")
const fs = require("fs")
const path = require("path")
//Github action
const action = yaml.safeLoad(fs.readFileSync("action.yml", "utf8"))
const action = yaml.safeLoad(fs.readFileSync(path.join(__dirname, "../action.yml"), "utf8"))
action.defaults = Object.fromEntries(Object.entries(action.inputs).map(([key, {default:value}]) => [key, /^(yes|no)$/.test(value) ? value === "yes" : value]))
action.input = vars => Object.fromEntries([...Object.entries(action.defaults), ...Object.entries(vars)].map(([key, value]) => [`INPUT_${key.toLocaleUpperCase()}`, value]))
action.run = async (vars) => await new Promise((solve, reject) => {