Throw a ConfigurationError if setup-codeql has run before init

This commit is contained in:
Michael B. Gale
2025-10-16 20:03:26 +01:00
parent 000295122d
commit c0e8887d5a
5 changed files with 20 additions and 0 deletions
+5
View File
@@ -90784,6 +90784,11 @@ async function run() {
if (statusReportBase !== void 0) {
await sendStatusReport(statusReportBase);
}
if (process.env["CODEQL_ACTION_SETUP_CODEQL_HAS_RUN" /* SETUP_CODEQL_ACTION_HAS_RUN */] === "true") {
throw new ConfigurationError(
`The 'init' action should not be run in the same workflow as 'setup-codeql'.`
);
}
const codeQLDefaultVersionInfo = await features.getDefaultCliVersion(
gitHubVersion.type
);
+1
View File
@@ -87583,6 +87583,7 @@ async function run() {
toolsSource = initCodeQLResult.toolsSource;
core12.setOutput("codeql-path", codeql.getPath());
core12.setOutput("codeql-version", (await codeql.getVersion()).version);
core12.exportVariable("CODEQL_ACTION_SETUP_CODEQL_HAS_RUN" /* SETUP_CODEQL_ACTION_HAS_RUN */, "true");
} catch (unwrappedError) {
const error2 = wrapError(unwrappedError);
core12.setFailed(error2.message);