Skip to content

Commit 0b8d151

Browse files
committed
Keep user-provided query filters first
1 parent f5304e7 commit 0b8d151

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

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-
No user facing changes.
7+
- Fix bug in PR analysis where user-provided `include` query filter fails to exclude non-included queries. [#2938](https://github.com/github/codeql-action/pull/2938)
88

99
## 3.29.0 - 11 Jun 2025
1010

src/codeql.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1266,8 +1266,12 @@ async function generateCodeScanningConfig(
12661266
}
12671267

12681268
augmentedConfig["query-filters"] = [
1269-
...(config.augmentationProperties.extraQueryExclusions || []),
1269+
// Ordering matters. If the first filter is an inclusion, it implicitly
1270+
// excludes all queries that are not included. If it is an exclusion,
1271+
// it implicitly includes all queries that are not excluded. So user
1272+
// filters (if any) should always be first to preserve intent.
12701273
...(augmentedConfig["query-filters"] || []),
1274+
...(config.augmentationProperties.extraQueryExclusions || []),
12711275
];
12721276
if (augmentedConfig["query-filters"]?.length === 0) {
12731277
delete augmentedConfig["query-filters"];

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy