mirror of
https://github.com/DavidAnson/markdownlint-cli2-action.git
synced 2024-12-22 21:03:53 +01:00
22 lines
481 B
JavaScript
22 lines
481 B
JavaScript
// @ts-check
|
|
|
|
"use strict";
|
|
|
|
const core = require("@actions/core");
|
|
const {"main": markdownlintCli2} = require("markdownlint-cli2");
|
|
|
|
const logMessage = core.info;
|
|
const logError = core.error;
|
|
const argv =
|
|
core.getInput("globs").
|
|
split("\n").
|
|
filter((glob) => String(glob));
|
|
|
|
markdownlintCli2({
|
|
argv,
|
|
logMessage,
|
|
logError
|
|
}).then(
|
|
(code) => code && core.setFailed(`Failed with exit code: ${code}`),
|
|
(error) => core.setFailed(`Failed due to error: ${error}`)
|
|
);
|