Skip to content

Commit 257b3d3

Browse files
committed
Enable only code-scanning
1 parent 312a2fe commit 257b3d3

4 files changed

Lines changed: 23 additions & 13 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ See the [releases page](https://github.com/github/codeql-action/releases) for th
44

55
## [UNRELEASED]
66

7-
- An error is now thrown if multiple inputs are provided for the GitHub-internal `analysis-kinds` input. The `analysis-kinds` input is experimental, for GitHub-internal use only, and may change without notice at any time. [#3892](https://github.com/github/codeql-action/pull/3892)
7+
- If multiple inputs are provided for the GitHub-internal `analysis-kinds` input, only `code-scanning` will be enabled. The `analysis-kinds` input is experimental, for GitHub-internal use only, and may change without notice at any time. [#3892](https://github.com/github/codeql-action/pull/3892)
88

99
## 4.35.4 - 07 May 2026
1010

lib/init-action.js

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/analyses.test.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
} from "./analyses";
1717
import { EnvVar } from "./environment";
1818
import { getRunnerLogger } from "./logging";
19-
import { createFeatures, setupTests } from "./testing-utils";
19+
import { createFeatures, RecordingLogger, setupTests } from "./testing-utils";
2020
import { AssessmentPayload } from "./upload-lib/types";
2121
import { ConfigurationError } from "./util";
2222

@@ -70,19 +70,21 @@ test.serial(
7070
);
7171

7272
test.serial(
73-
"getAnalysisKinds - throws for multiple analysis kinds outside of test mode",
73+
"getAnalysisKinds - only use `code-scanning` for multiple analysis kinds outside of test mode",
7474
async (t) => {
7575
process.env[EnvVar.TEST_MODE] = "false";
7676
const features = createFeatures([]);
77+
const logger = new RecordingLogger();
7778
const requiredInputStub = sinon.stub(actionsUtil, "getRequiredInput");
7879
requiredInputStub
7980
.withArgs("analysis-kinds")
8081
.returns("code-scanning,code-quality");
81-
await t.throwsAsync(
82-
getAnalysisKinds(getRunnerLogger(true), features, true),
83-
{
84-
instanceOf: ConfigurationError,
85-
},
82+
const result = await getAnalysisKinds(logger, features, true);
83+
t.deepEqual(result, [AnalysisKind.CodeScanning]);
84+
t.assert(
85+
logger.hasMessage(
86+
"Continuing with only `analysis-kinds: code-scanning`.",
87+
),
8688
);
8789
},
8890
);

src/analyses.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,17 +122,23 @@ export async function getAnalysisKinds(
122122
}
123123
}
124124

125-
// Throw an error if we have multiple inputs for `analysis-kinds` outside of test mode.
125+
// Log an error if we have multiple inputs for `analysis-kinds` outside of test mode,
126+
// and enable only `code-scanning`.
126127
if (
127128
!isInTestMode() &&
128129
analysisKinds.length > 1 &&
129130
!(await features.getValue(Feature.AllowMultipleAnalysisKinds))
130131
) {
131-
throw new ConfigurationError(
132+
logger.error(
132133
"The `analysis-kinds` input is experimental and for GitHub-internal use only. " +
133134
"Its behaviour may change at any time or be removed entirely. " +
134-
"Specifying multiple values as input is no longer supported.",
135+
"Specifying multiple values as input is no longer supported. " +
136+
"Continuing with only `analysis-kinds: code-scanning`.",
135137
);
138+
139+
// Only enable Code Scanning.
140+
cachedAnalysisKinds = [AnalysisKind.CodeScanning];
141+
return cachedAnalysisKinds;
136142
}
137143

138144
// Cache the analysis kinds and return them.

0 commit comments

Comments
 (0)