All files / src/core main.ts

100% Statements 14/14
100% Branches 2/2
100% Functions 1/1
100% Lines 14/14

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 261x                 3x 3x 3x   3x 3x   3x 5x 5x   3x 3x 3x 3x 3x  
import * as core from "@actions/core";
import { getDirectories } from "../utils/directories";
import { getInputs } from "../utils/inputs";
import { generate } from "./generator";
 
/**
 * The main function for the action.
 * @returns {Promise<void>} Resolves when the action is complete.
 */
export async function run() {
	const start = new Date();
	core.info(`Starting action at ${start.toLocaleString()}`);
 
	const inputs = getInputs();
	const { root, directories } = await getDirectories(inputs.target, inputs.ignore);
 
	for (const dir of directories) {
		await generate(root, dir, inputs);
	}
 
	const end = new Date();
	core.info(`Action completed at ${end.toLocaleString()}`);
	const diff = end.getTime() - start.getTime();
	core.info(`Total time: ${diff}ms`);
}