Skip to content

CodeQl: Support repos with no packages. - #525

Merged
Aaron (apop5) merged 1 commit into
microsoft:mainfrom
apop5:personal/apop5/supportdepreciatedrepos
Feb 25, 2026
Merged

Aaron (apop5) merged 1 commit into
microsoft:mainfrom
apop5:personal/apop5/supportdepreciatedrepos

Conversation

@apop5

Copy link
Copy Markdown
Contributor

The codeql workflow will attempting to locate Packages by finding folders ending with pkg and then attempting to find a .dsc located within that folder.

For repos without any valid pkgs, the codeql workflow will generate an empty matrix. Adding a package_count variable to differentiate this scenario and gate creating and empty matrix.

Most repos list the codeql Analyze task as a required check. With an empty matrix, this would fail. Skipping the Analyze task would result in a pending check that will never execute.

Modify the codeql to create an empty sarif file when the package_count is zero and upload this. This will allow the Analyze step to run and pass CI when a repo contains no valid packages that can have results uploaded.

This is being handled in this manor to allow the same CI checks to exist for repos which still contain a valid release/202502 branch, and a release/202511 branch which deprecates the repo.

The codeql workflow will attempting to locate Packages by finding folders ending with pkg
and then attempting to find a .dsc located within that folder.

For repos without any valid pkgs, the codeql workflow will generate an empty matrix.
Adding a package_count variable to differentiate this scenario and gate creating and
empty matrix.

Most repos list the codeql Analyze task as a required check. With an empty matrix,
this would fail. Skipping the Analyze task would result in a pending check that will never execute.

Modify the codeql to create an empty sarif file when the package_count is zero and upload this.
This will allow the Analyze step to run and pass CI when a repo contains no valid packages
that can have results uploaded.

This is being handled in this manor to allow the same CI checks to exist for repos which
still contain a valid release/202502 branch, and a release/202511 branch which
deprecates the repo.
@apop5

Copy link
Copy Markdown
Contributor Author

Code has been verified here:

microsoft/mu_silicon_intel_tiano#342

@apop5
Aaron (apop5) merged commit 9e9450f into microsoft:main Feb 25, 2026
2 checks passed
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.

3 participants