-
Notifications
You must be signed in to change notification settings - Fork 171
Add GitHub Actions workflow for Copilot environment setup and consolidate .NET setup across all workflows #830
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
Add GitHub Actions workflow for Copilot environment setup and consolidate .NET setup across all workflows #830
Conversation
… setup Co-authored-by: BenjaminMichaelis <[email protected]>
|
@copilot do we need a package json and package lock? And where do we use node in this project? And can we have a reusable action to share the basic .net setup (install restore build) between the workflows? |
Co-authored-by: BenjaminMichaelis <[email protected]>
You're absolutely right on all three points:
The workflow now focuses solely on .NET environment setup, which is what this project actually needs. Commit: b098362 |
|
@copilot could the setup .net action include build and restore as well? And just only ever use the global json since we have it? And should our main CI file also use this reusable action |
… to use it Co-authored-by: BenjaminMichaelis <[email protected]>
Absolutely! Made all three improvements:
The reusable action is now much more comprehensive and all workflows are cleaner and more maintainable. Commit: 49acef2 |
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 adds a new GitHub Actions workflow for Copilot environment setup and consolidates .NET setup configuration across all workflows using a reusable action. The changes remove Node.js components that weren't needed for this .NET-only project and create a consistent approach to .NET environment configuration.
Key changes:
- New Copilot setup workflow that focuses on .NET environment rather than Node.js
- Reusable .NET setup action that handles SDK setup, caching, restore, and optional build
- Updated existing workflows to use the centralized setup action, eliminating code duplication
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
.github/workflows/copilot-setup-steps.yml |
New workflow for Copilot environment setup using .NET only |
.github/workflows/build-and-test.yml |
Refactored to use reusable .NET setup action with build enabled |
.github/workflows/Code-Analysis.yml |
Updated to use reusable .NET setup action without build step |
.github/actions/setup-dotnet/action.yml |
New composite action consolidating .NET setup, caching, and restore logic |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <[email protected]>
This PR adds a new GitHub Actions workflow file to preconfigure Copilot's environment before the agent starts, following the GitHub Copilot Agents documentation best practices. Additionally, it creates a comprehensive reusable .NET setup action and updates all existing workflows to use it for consistency and maintainability.
What's Added
.github/workflows/copilot-setup-steps.ymlcopilot-setup-stepswith minimal permissions (contents: read).github/actions/setup-dotnet/action.ymldotnet restoreand includes optionalbuildparameterglobal.jsonexclusively for consistent .NET SDK version managementUpdated Existing Workflows
build-and-test.yml: Now uses reusable action withbuild: 'true'parameterCode-Analysis.yml: Now uses reusable action for setup and restoreEnvironment Setup Steps
actions/checkout@v5(consistent with existing workflows)Design Decisions
global.jsonfor .NET version management across all workflowscontents: readpermission for securityThe changes result in cleaner, more maintainable workflows while ensuring Copilot agents have access to the necessary .NET tools and dependencies. All workflows now follow a consistent pattern for .NET environment setup.
Benefits
Warning
http://crl3.digicert.com:443/sha2-assured-cs-g1.crldotnet restore(http block)If you need me to access, download, or install something from one of these locations, you can either:
This pull request was created as a result of the following prompt from Copilot chat.
This pull request was created as a result of the following prompt from Copilot chat.
💡 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.