-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Update Copilot setup to use .NET SDK version from tools.dotnet #11891
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
base: main
Are you sure you want to change the base?
Conversation
Hello @@copilot, I noticed that you’re changing an .swr file or any file under src/Package/MSBuild.VSSetup.. Please make sure to validate this change by an experimental VS insertion. This is accomplished by pushing to an exp/* branch, which requires write permissions to this repo. |
Co-authored-by: rainersigwald <[email protected]>
There was a problem hiding this 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 GitHub Actions workflow to pull the .NET SDK version from the custom tools.dotnet
property in global.json
and supply it directly to actions/setup-dotnet
.
- Added a step to extract the SDK version using
jq
and set it in the environment - Switched
setup-dotnet
fromglobal-json-file
to the extracteddotnet-version
parameter
Comments suppressed due to low confidence (2)
.github/workflows/copilot-setup-steps.yml:20
- [nitpick] Ensure this new step’s indentation matches the existing steps (two extra spaces), so it aligns under
steps:
with other- uses:
entries.
- name: Extract SDK version from global.json
.github/workflows/copilot-setup-steps.yml:23
- [nitpick] Verify that
jq
is available on the runner (or add an install step) to avoid failures on environments wherejq
isn’t preinstalled.
SDK_VERSION=$(jq -r '.tools.dotnet' global.json)
- name: Extract SDK version from global.json | ||
id: sdk-version | ||
run: | | ||
SDK_VERSION=$(jq -r '.tools.dotnet' global.json) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a validation after extraction (e.g., fail early if $SDK_VERSION
is empty) to catch errors when tools.dotnet
is missing or malformed.
SDK_VERSION=$(jq -r '.tools.dotnet' global.json) | |
SDK_VERSION=$(jq -r '.tools.dotnet' global.json) | |
if [ -z "$SDK_VERSION" ]; then | |
echo "Error: .NET SDK version is missing or malformed in global.json" >&2 | |
exit 1 | |
fi |
Copilot uses AI. Check for mistakes.
Our repository uses a non-standard approach to specifying the .NET SDK version in global.json. Instead of using the standard
sdk.version
property, we use the Arcade-specifictools.dotnet
element.This PR updates the Copilot setup steps to:
tools.dotnet
usingjq
setup-dotnet
using thedotnet-version
parameterBefore this change, Copilot was using the
global-json-file
parameter which doesn't understand our custom structure, potentially using an incorrect SDK version.Fixes #11890.
💡 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.