3 Commits

Author SHA1 Message Date
Trez.One 463e2b5545 Re-doing bundling...
Release Bundled Action / release (push) Successful in 1m51s
Renovate / renovate (push) Successful in 5m46s
2025-11-19 13:51:13 -05:00
Trez.One 9a7015553a Removing original ./index.js.
Release Bundled Action / release (push) Successful in 1m55s
Renovate / renovate (push) Failing after 4m34s
2025-11-19 13:16:11 -05:00
Trez.One 8987d79032 Updating path for index.js.
Release Bundled Action / release (push) Successful in 1m22s
Renovate / renovate (push) Failing after 5m23s
2025-11-19 11:54:35 -05:00
5 changed files with 26 additions and 27 deletions
+12 -11
View File
@@ -5,9 +5,7 @@ import fs from "fs";
export function main() {
const converter = new Converter();
const input = core.getInput("input", { required: false });
const encoding = core.getInput("encoding", {
required: true,
});
const encoding = core.getInput("encoding", { required: true });
const path = core.getInput("path", { required: false });
if (!input && !path) {
@@ -15,20 +13,23 @@ export function main() {
}
if (input && path) {
return core.setFailed(
"You must provide either an input or path, not both."
);
return core.setFailed("You must provide either an input or path, not both.");
}
if (input && input !== "") {
if (input) {
core.setOutput("contents", converter.toHtml(input));
} else if (path && path !== "") {
} else {
if (!fs.existsSync(path)) {
return core.setFailed(`Path ${path} does not exist.`);
}
const rawContents = fs.readFileSync(path).toString(encoding);
core.setOutput("contents", converter.toHtml(rawContents));
const raw = fs.readFileSync(path).toString(encoding);
core.setOutput("contents", converter.toHtml(raw));
}
}
try {
main();
} catch (err) {
core.setFailed(err.message);
}
+1 -1
View File
@@ -20,4 +20,4 @@ outputs:
description: "The input or contents of path where all ANSI codes have been replaced with HTML color codes."
runs:
using: "node16"
main: "./index.js"
main: "dist/index.js"
+11 -11
View File
@@ -3762,9 +3762,7 @@ var __webpack_exports__ = {};
function main() {
const converter = new ansi_to_html__WEBPACK_IMPORTED_MODULE_0__();
const input = _actions_core__WEBPACK_IMPORTED_MODULE_1__.getInput("input", { required: false });
const encoding = _actions_core__WEBPACK_IMPORTED_MODULE_1__.getInput("encoding", {
required: true,
});
const encoding = _actions_core__WEBPACK_IMPORTED_MODULE_1__.getInput("encoding", { required: true });
const path = _actions_core__WEBPACK_IMPORTED_MODULE_1__.getInput("path", { required: false });
if (!input && !path) {
@@ -3772,24 +3770,26 @@ function main() {
}
if (input && path) {
return _actions_core__WEBPACK_IMPORTED_MODULE_1__.setFailed(
"You must provide either an input or path, not both."
);
return _actions_core__WEBPACK_IMPORTED_MODULE_1__.setFailed("You must provide either an input or path, not both.");
}
if (input && input !== "") {
if (input) {
_actions_core__WEBPACK_IMPORTED_MODULE_1__.setOutput("contents", converter.toHtml(input));
} else if (path && path !== "") {
} else {
if (!fs__WEBPACK_IMPORTED_MODULE_2__.existsSync(path)) {
return _actions_core__WEBPACK_IMPORTED_MODULE_1__.setFailed(`Path ${path} does not exist.`);
}
const rawContents = fs__WEBPACK_IMPORTED_MODULE_2__.readFileSync(path).toString(encoding);
_actions_core__WEBPACK_IMPORTED_MODULE_1__.setOutput("contents", converter.toHtml(rawContents));
const raw = fs__WEBPACK_IMPORTED_MODULE_2__.readFileSync(path).toString(encoding);
_actions_core__WEBPACK_IMPORTED_MODULE_1__.setOutput("contents", converter.toHtml(raw));
}
}
try {
main();
} catch (err) {
_actions_core__WEBPACK_IMPORTED_MODULE_1__.setFailed(err.message);
}
})();
var __webpack_exports__main = __webpack_exports__.D;
-3
View File
@@ -1,3 +0,0 @@
import { main } from "./action.js";
main();
+2 -1
View File
@@ -14,7 +14,8 @@
"scripts": {
"lint": "eslint --ext js .",
"release": "npx semantic-release",
"test": "npx cross-env FORCE_COLOR=1 npx jest"
"test": "npx cross-env FORCE_COLOR=1 npx jest",
"build": "ncc build action.js -o dist"
},
"dependencies": {
"@actions/core": "^1.9.1",