gh-gei icon indicating copy to clipboard operation
gh-gei copied to clipboard

Add copilot-setup-steps.yml to customize development environment for Copilot Coding Agent

Open Copilot opened this issue 6 months ago • 2 comments

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.

Copilot avatar Jun 12 '25 20:06 Copilot

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

dylan-smith avatar Jun 12 '25 21:06 dylan-smith

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 avatar Jun 12 '25 21:06 Copilot