Skip to content

Give CodeQL a full clone so Nerdbank.GitVersioning can version the build - #1

Merged
davidnmbond merged 1 commit into
mainfrom
fix/codeql-full-clone
Oct 3, 2026
Merged

davidnmbond merged 1 commit into
mainfrom
fix/codeql-full-clone

Conversation

@davidnmbond

Copy link
Copy Markdown

Cause

The CodeQL Analyze (csharp) job fails on main and on pull requests. actions/checkout defaults to a shallow clone (fetch-depth: 1), so Nerdbank.GitVersioning cannot compute the version height and autobuild stops with:

Shallow clone lacks the objects required to calculate version height

Fix

Set fetch-depth: 0 on the checkout step of the CodeQL workflow so the job gets full history. This is the same one-line change proven on panoramicdata/HubSpot.Api#8.

Tracked under OPS-157454.

🤖 Generated with Claude Code

…rsion the build

CodeQL's autobuild failed on every run because the default shallow checkout
lacks the history Nerdbank.GitVersioning needs to compute the version height.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@codacy-production codacy-production Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

The PR updates the CodeQL workflow to use a full git clone by setting fetch-depth: 0. This change correctly addresses build failures where Nerdbank.GitVersioning could not calculate version height due to a shallow clone. Codacy analysis indicates the change is up to standards, and no security or logic issues were found.

Test suggestions

  • Verify the CodeQL 'Analyze (csharp)' job completes successfully without version height calculation errors.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Verify the CodeQL 'Analyze (csharp)' job completes successfully without version height calculation errors.

TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback

@davidnmbond
davidnmbond merged commit 233935e into main Oct 3, 2026
5 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.

1 participant