Implement support for language aliasing

This commit is contained in:
Henry Mercer 2023-09-14 15:26:38 +01:00
parent e982de4fb4
commit 74714a34ca
15 changed files with 121 additions and 61 deletions

View file

@ -38,11 +38,14 @@ const ENVIRONMENT_OUTPUT_NAME = "environment";
async function run() {
const startedAt = new Date();
const logger = (0, logging_1.getActionsLogger)();
const language = (0, languages_1.resolveAlias)((0, actions_util_1.getRequiredInput)("language"));
try {
if (!(await (0, status_report_1.sendStatusReport)(await (0, status_report_1.createStatusReportBase)(ACTION_NAME, "starting", startedAt, await (0, util_1.checkDiskUsage)(logger))))) {
return;
}
const language = (0, languages_1.parseLanguage)((0, actions_util_1.getRequiredInput)("language"));
if (language === undefined) {
throw new Error(`Did not recognize the language "${(0, actions_util_1.getRequiredInput)("language")}".`);
}
const gitHubVersion = await (0, api_client_1.getGitHubVersion)();
(0, util_1.checkGitHubVersionInRange)(gitHubVersion, logger);
const config = await configUtils.getConfig((0, actions_util_1.getTemporaryDirectory)(), logger);