chore: testing

This commit is contained in:
Justin McCormick
2022-08-16 01:59:04 -04:00
parent a28ec64800
commit 23f9be033a
10 changed files with 17404 additions and 55 deletions
+2 -25
View File
@@ -1,26 +1,3 @@
import core from "@actions/core";
import Converter from "ansi-to-html";
import fs from "fs";
import { main } from "./action.js";
const converter = new Converter();
const input = core.getInput("input", { required: false });
const encoding = core.getInput("encoding", {
required: true,
});
const path = core.getInput("path", { required: false });
if (!input && !path) {
core.setFailed("You must provide either an input or path.");
}
if (input && path) {
core.setFailed("You must provide either an input or path, not both.");
}
if (input && input !== "") {
core.setOutput("contents", converter.toHtml(input));
} else if (path && path !== "") {
const rawContents = fs.readFileSync(path).toString(encoding);
core.setOutput("contents", converter.toHtml(rawContents));
}
main();