Skip to content

Fixes #1443: per-language CodeQL targeting#1510

Merged
edburns merged 2 commits into
mainfrom
edburns/1443-codeql-targeting
May 29, 2026
Merged

Fixes #1443: per-language CodeQL targeting#1510
edburns merged 2 commits into
mainfrom
edburns/1443-codeql-targeting

Conversation

@edburns
Copy link
Copy Markdown
Collaborator

@edburns edburns commented May 29, 2026

  • The changes job now outputs a matrix JSON instead of per-language booleans
  • paths-filter only runs on pull_request (on push/schedule, all languages are included)
  • The analyze job uses matrix: ${{ fromJson(needs.changes.outputs.matrix) }} — only jobs for changed languages are created
  • if: ${{ fromJson(needs.changes.outputs.matrix).include[0] != null }} prevents the job from running when no languages changed

- The `changes` job now outputs a `matrix` JSON instead of per-language booleans
- `paths-filter` only runs on `pull_request` (on `push`/`schedule`, all languages are included)
- The `analyze` job uses `matrix: ${{ fromJson(needs.changes.outputs.matrix) }}` — only jobs for changed languages are created
- `if: ${{ fromJson(needs.changes.outputs.matrix).include[0] != null }}` prevents the job from running when no languages changed
@edburns edburns requested a review from a team as a code owner May 29, 2026 22:45
Copilot AI review requested due to automatic review settings May 29, 2026 22:45
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 updates the CodeQL workflow to build a dynamic analysis matrix so pull requests only create CodeQL jobs for languages affected by changed paths, while push and scheduled runs still analyze all configured languages.

Changes:

  • Replaces per-language changes outputs with a single JSON matrix output.
  • Runs paths-filter only for pull requests.
  • Uses the generated matrix directly in the CodeQL analyze job and skips it when no language entries are present.
Show a summary per file
File Description
.github/workflows/codeql.yml Adds dynamic CodeQL matrix construction and removes per-step language gate conditions.

Copilot's findings

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

@edburns edburns enabled auto-merge May 29, 2026 22:50
@edburns edburns disabled auto-merge May 29, 2026 22:51
@edburns edburns enabled auto-merge May 29, 2026 22:51
Code scanning branch protection expects results for every
category previously uploaded on main. When the dynamic matrix
excludes a language (no paths changed), the missing category
blocks PR merge.

Add a skip-analysis job that uploads an empty SARIF file for
each language not included in the analysis matrix, so all 7
categories always have results.
@edburns edburns disabled auto-merge May 29, 2026 23:00
@edburns edburns merged commit 5522793 into main May 29, 2026
15 checks passed
@edburns edburns deleted the edburns/1443-codeql-targeting branch May 29, 2026 23:00
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.

2 participants