mirror of
https://github.com/github/codeql-action.git
synced 2026-05-08 23:00:26 +00:00
Refactoring: Create interface for config initialization
This eliminates argument order mistakes, and also lets us add new inputs without having to update every test.
This commit is contained in:
+18
-16
@@ -265,29 +265,31 @@ async function run() {
|
||||
}
|
||||
core.endGroup();
|
||||
|
||||
config = await initConfig(
|
||||
getOptionalInput("languages"),
|
||||
getOptionalInput("queries"),
|
||||
getOptionalInput("packs"),
|
||||
getOptionalInput("config-file"),
|
||||
getOptionalInput("db-location"),
|
||||
getOptionalInput("config"),
|
||||
getTrapCachingEnabled(),
|
||||
config = await initConfig({
|
||||
languagesInput: getOptionalInput("languages"),
|
||||
queriesInput: getOptionalInput("queries"),
|
||||
packsInput: getOptionalInput("packs"),
|
||||
configFile: getOptionalInput("config-file"),
|
||||
dbLocation: getOptionalInput("db-location"),
|
||||
configInput: getOptionalInput("config"),
|
||||
trapCachingEnabled: getTrapCachingEnabled(),
|
||||
// Debug mode is enabled if:
|
||||
// - The `init` Action is passed `debug: true`.
|
||||
// - Actions step debugging is enabled (e.g. by [enabling debug logging for a rerun](https://docs.github.com/en/actions/managing-workflow-runs/re-running-workflows-and-jobs#re-running-all-the-jobs-in-a-workflow),
|
||||
// or by setting the `ACTIONS_STEP_DEBUG` secret to `true`).
|
||||
getOptionalInput("debug") === "true" || core.isDebug(),
|
||||
getOptionalInput("debug-artifact-name") || DEFAULT_DEBUG_ARTIFACT_NAME,
|
||||
getOptionalInput("debug-database-name") || DEFAULT_DEBUG_DATABASE_NAME,
|
||||
repositoryNwo,
|
||||
getTemporaryDirectory(),
|
||||
debugMode: getOptionalInput("debug") === "true" || core.isDebug(),
|
||||
debugArtifactName:
|
||||
getOptionalInput("debug-artifact-name") || DEFAULT_DEBUG_ARTIFACT_NAME,
|
||||
debugDatabaseName:
|
||||
getOptionalInput("debug-database-name") || DEFAULT_DEBUG_DATABASE_NAME,
|
||||
repository: repositoryNwo,
|
||||
tempDir: getTemporaryDirectory(),
|
||||
codeql,
|
||||
getRequiredEnvParam("GITHUB_WORKSPACE"),
|
||||
gitHubVersion,
|
||||
workspacePath: getRequiredEnvParam("GITHUB_WORKSPACE"),
|
||||
githubVersion: gitHubVersion,
|
||||
apiDetails,
|
||||
logger,
|
||||
);
|
||||
});
|
||||
|
||||
await checkInstallPython311(config.languages, codeql);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user