Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jun 12, 2025

This PR adds a copilot-setup-steps.yml workflow file to customize the development environment for GitHub Copilot Coding Agent, preventing it from trying to modify the .NET SDK version in future PRs.

Problem

Copilot Coding Agent has been consistently trying to change the .NET SDK version in PRs from the repository's specified version (8.0.410 in global.json) to match the version installed in the Copilot environment (8.0.116). This requires manual intervention to revert these unwanted changes in each PR.

Solution

Added .github/copilot-setup-steps.yml that explicitly instructs Copilot how to set up the development environment to match the repository's requirements. The workflow includes the essential steps:

  • Setup .NET: Uses actions/setup-dotnet@v2 with global-json-file: global.json to ensure the correct SDK version (8.0.410)
  • Restore dependencies: dotnet restore src/OctoshiftCLI.sln
  • Format code: dotnet format src/OctoshiftCLI.sln --verify-no-changes
  • Build: dotnet build src/OctoshiftCLI.sln --no-restore

Expected Outcome

With this configuration, Copilot will use the repository's specified .NET SDK version from global.json instead of trying to modify the project to match its environment. This eliminates the need for manual intervention in PRs to revert SDK version changes.

Verification

✅ Tested that setup steps work correctly with .NET SDK 8.0.410
✅ Verified all builds pass: restore, format, build, and tests (888 tests passing)
✅ Confirmed no unwanted changes to existing files
✅ Minimal change: only 1 new file added

Fixes #1358.


💡 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.

Co-authored-by: dylan-smith <1508559+dylan-smith@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Customize the development environment for Copilot Coding Agent Add copilot-setup-steps.yml to customize development environment for Copilot Coding Agent Jun 12, 2025
@Copilot Copilot AI requested a review from dylan-smith June 12, 2025 20:33
Copilot finished work on behalf of dylan-smith June 12, 2025 20:33
Co-authored-by: dylan-smith <1508559+dylan-smith@users.noreply.github.com>
Copilot finished work on behalf of dylan-smith June 12, 2025 21:01
Co-authored-by: dylan-smith <1508559+dylan-smith@users.noreply.github.com>
Copilot finished work on behalf of dylan-smith June 12, 2025 21:03
@dylan-smith
Copy link
Contributor

The file must be in the .github/workflows/ folder or github/copilot won't use it.

Co-authored-by: dylan-smith <1508559+dylan-smith@users.noreply.github.com>
Copilot finished work on behalf of dylan-smith June 12, 2025 21:06
Co-authored-by: dylan-smith <1508559+dylan-smith@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jun 12, 2025

The file must be in the .github/workflows/ folder or github/copilot won't use it.

Moved the copilot-setup-steps.yml file to .github/workflows/ folder and updated the path references in the workflow triggers. (588bc68)

Copilot finished work on behalf of dylan-smith June 12, 2025 21:09
@dylan-smith dylan-smith marked this pull request as ready for review June 12, 2025 22:57
@dylan-smith dylan-smith requested a review from a team June 12, 2025 22:58
@dylan-smith dylan-smith merged commit 0291102 into main Jun 20, 2025
38 of 54 checks passed
@dylan-smith dylan-smith deleted the copilot/fix-1358 branch June 20, 2025 14:23
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.

Customize the development environment for Copilot Coding Agent
3 participants