Skip to content

Add path-filtered CodeQL workflow for content-specific analysis#1444

Merged
edburns merged 6 commits into
mainfrom
copilot/consider-tuning-code-ql-checks
May 29, 2026
Merged

Add path-filtered CodeQL workflow for content-specific analysis#1444
edburns merged 6 commits into
mainfrom
copilot/consider-tuning-code-ql-checks

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 26, 2026

CodeQL default setup runs all 7 language analyzers on every PR regardless of which files changed. A Java-only PR shouldn't wait for Python, Go, C#, JS, and Actions scans.

Adds .github/workflows/codeql.yml (advanced setup) with dorny/paths-filter to gate each language's analysis on whether its directory actually has changes:

  • PR behavior: Only analyzes languages with changed files (java/**java-kotlin, nodejs/**/scripts/**javascript-typescript, etc.)
  • Push/schedule behavior: Analyzes all languages unconditionally for full coverage on main and weekly scheduled runs
  • Matrix strategy: Each language has an independent gate output; jobs that don't match skip all steps cleanly

Requires admin action: A repo admin must switch CodeQL from "Default" to "Advanced" setup in Settings → Code security → Code scanning. Branch protection required checks may need updating if check names change.

Copilot AI and others added 2 commits May 26, 2026 23:49
Create .github/workflows/codeql.yml that uses dorny/paths-filter to
detect which language directories changed, then only runs CodeQL
analysis for those languages. This replaces the default setup which
analyzed all languages on every PR regardless of changed files.

On push to main and scheduled runs, all languages are analyzed.
On PRs, only languages with changed files are analyzed.

Co-authored-by: edburns <75821+edburns@users.noreply.github.com>
Co-authored-by: edburns <75821+edburns@users.noreply.github.com>
Copilot AI changed the title [WIP] Consider tuning Code QL checks for Java files Add path-filtered CodeQL workflow for content-specific analysis May 26, 2026
Copilot AI requested a review from edburns May 26, 2026 23:51
@edburns edburns marked this pull request as ready for review May 29, 2026 21:26
@edburns edburns requested a review from a team as a code owner May 29, 2026 21:26
Copilot AI review requested due to automatic review settings May 29, 2026 21:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces an “advanced” CodeQL workflow that conditionally runs per-language analysis on pull requests based on which parts of the repo changed, while still running full multi-language scans on main pushes and on a weekly schedule.

Changes:

  • Adds .github/workflows/codeql.yml using dorny/paths-filter to detect which language directories changed on PRs.
  • Runs CodeQL as a matrix job with per-language gates so unaffected languages skip work on PRs.
  • Configures push-to-main and scheduled runs to analyze languages unconditionally for full coverage.
Show a summary per file
File Description
.github/workflows/codeql.yml Adds path-filtered, matrix-based CodeQL scanning intended to reduce PR-time analysis work while retaining full scans on push/schedule.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 10

Comment thread .github/workflows/codeql.yml
Comment on lines +40 to +46
python:
- 'python/**'
go:
- 'go/**'
csharp:
- 'dotnet/**'
actions:
Comment on lines +68 to +75
- language: python
gate: python
- language: go
gate: go
- language: csharp
gate: csharp
- language: actions
gate: actions
Comment on lines +37 to +40
js:
- 'nodejs/**'
- 'scripts/**'
python:
Comment on lines +16 to +18
changes:
name: Detect changed paths
runs-on: ubuntu-latest
Comment on lines +23 to +28
java: ${{ steps.filter.outputs.java }}
js: ${{ steps.filter.outputs.js }}
python: ${{ steps.filter.outputs.python }}
go: ${{ steps.filter.outputs.go }}
csharp: ${{ steps.filter.outputs.csharp }}
actions: ${{ steps.filter.outputs.actions }}
Comment on lines +40 to +46
python:
- 'python/**'
go:
- 'go/**'
csharp:
- 'dotnet/**'
actions:
Comment on lines +68 to +75
- language: python
gate: python
- language: go
gate: go
- language: csharp
gate: csharp
- language: actions
gate: actions
Comment on lines +37 to +40
js:
- 'nodejs/**'
- 'scripts/**'
python:
Comment on lines +16 to +18
changes:
name: Detect changed paths
runs-on: ubuntu-latest
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: edburns <75821+edburns@users.noreply.github.com>
@edburns edburns merged commit d3b33c0 into main May 29, 2026
21 of 22 checks passed
@edburns edburns deleted the copilot/consider-tuning-code-ql-checks branch May 29, 2026 21:48
@edburns edburns mentioned this pull request May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider tuning Code QL checks to be content-specific

3 participants