-
-
Notifications
You must be signed in to change notification settings - Fork 177
Auto-disable git engine for GitHub Copilot environments #1291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: AArnott <3548+AArnott@users.noreply.github.com>
Co-authored-by: AArnott <3548+AArnott@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix NBGV_GitEngine variable detection in Copilot context
Auto-disable git engine for GitHub Copilot environments
Oct 30, 2025
Copilot finished work on behalf of
AArnott
October 30, 2025 14:54
AArnott
approved these changes
Oct 30, 2025
This was referenced Nov 5, 2025
Merged
This was referenced Nov 10, 2025
Open
Open
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
GitHub Copilot uses shallow clones which break Nerdbank.GitVersioning. Similar to the existing Dependabot auto-detection, this adds automatic detection of GitHub Copilot environments to disable the git engine without manual configuration.
Implementation
IsGitHubCopilotEnvironment()that checks forGITHUB_ACTOR=copilot-swe-agent[bot]GetEffectiveGitEngine()to auto-disable when Copilot is detected andNBGV_GitEngineis not explicitly setNBGV_GitEngineenvironment variable overrides auto-detection (same as Dependabot)Tests
Added three test scenarios:
GITHUB_ACTORvalues don't trigger (5 cases: user, dependabot[bot], copilot-swe-agent, COPILOT-SWE-AGENT[BOT], empty)NBGV_GitEngineoverrides Copilot detectionUpdated existing tests to clear
GITHUB_ACTORfor isolation.Documentation
Updated
shallow-cloning-agents.mdto document auto-detection and note manual configuration as optional fallback.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
3dovsblobprodeus2188.blob.core.windows.netdotnet restore --no-dependencies /home/REDACTED/work/Nerdbank.GitVersioning/.codeql-scratch/dbs/csharp/working/32A0A2D38A721DD2A3E59F6279CF8961/missingpackages_workingdir --packages /home/REDACTED/work/Nerdbank.GitVersioning/.codeql-scratch/dbs/csharp/working/missingpackages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal --configfile /home/REDACTED/work/Nerdbank.GitVersioning/.codeql-scratch/dbs/csharp/working/nugetconfig/nuget.config --force(dns block)aka.mscurl -I -sSL --retry 5 --retry-delay 2 --connect-timeout 15 REDACTED(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.