mirror of
https://github.com/github/codeql-action.git
synced 2026-10-30 01:27:22 +00:00
Convert rest of the actions
This commit is contained in:
21
src/autobuild.ts
Normal file
21
src/autobuild.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { getCodeQL } from './codeql';
|
||||
import * as config_utils from './config-utils';
|
||||
import { isTracedLanguage, Language } from './languages';
|
||||
import { Logger } from './logging';
|
||||
|
||||
export async function runAutobuild(
|
||||
language: Language,
|
||||
tmpDir: string,
|
||||
logger: Logger) {
|
||||
|
||||
if (!isTracedLanguage(language)) {
|
||||
throw new Error(`Cannot build "${language}" as it is not a traced language`);
|
||||
}
|
||||
|
||||
const config = await config_utils.getConfig(tmpDir, logger);
|
||||
|
||||
logger.startGroup(`Attempting to automatically build ${language} code`);
|
||||
const codeQL = getCodeQL(config.codeQLCmd);
|
||||
await codeQL.runAutobuild(language);
|
||||
logger.endGroup();
|
||||
}
|
||||
Reference in New Issue
Block a user