Skip to content

Commit 7f81363

Browse files
committed
Mark result of appendExtraQueryExclusions as Readonly to prevent further modification
1 parent e9fb72d commit 7f81363

9 files changed

+22
-21
lines changed

lib/analyze-action-post.js

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

lib/analyze-action.js

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

lib/autobuild-action.js

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

lib/init-action-post.js

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

lib/init-action.js

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

lib/resolve-environment-action.js

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

lib/upload-lib.js

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

lib/upload-sarif-action.js

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

src/config-utils.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1489,14 +1489,15 @@ export function generateCodeScanningConfig(
14891489
export function appendExtraQueryExclusions(
14901490
extraQueryExclusions: ExcludeQueryFilter[],
14911491
cliConfig: UserConfig,
1492-
): UserConfig {
1492+
): Readonly<UserConfig> {
1493+
// make a copy so we can modify it and so that modifications to the input
1494+
// object do not affect the result that is marked as `Readonly`.
1495+
const augmentedConfig = cloneObject(cliConfig);
1496+
14931497
if (extraQueryExclusions.length === 0) {
1494-
return cliConfig;
1498+
return augmentedConfig;
14951499
}
14961500

1497-
// make a copy so we can modify it
1498-
const augmentedConfig = cloneObject(cliConfig);
1499-
15001501
augmentedConfig["query-filters"] = [
15011502
// Ordering matters. If the first filter is an inclusion, it implicitly
15021503
// excludes all queries that are not included. If it is an exclusion,

0 commit comments

Comments
 (0)