Skip to content

Add Copilot multi-version .NET environment workflow - #10

Draft
dburriss with Copilot wants to merge 2 commits into
mainfrom
copilot/create-multi-version-dotnet-workflow
Draft

dburriss with Copilot wants to merge 2 commits into
mainfrom
copilot/create-multi-version-dotnet-workflow

Conversation

Copilot AI commented Dec 11, 2025

Copy link
Copy Markdown
Contributor

Creates a GitHub Actions workflow that configures .NET 6, 8, and 10 SDKs for Copilot agent environment customization.

Workflow Configuration

  • Multi-version setup: Single step installs .NET 6.0.428, 8.0.416, 10.0.101 using actions/setup-dotnet@v4 with pipe-delimited version syntax
  • Performance: NuGet package caching via both actions/setup-dotnet built-in cache and explicit actions/cache@v4 targeting ~/.nuget/packages
  • Tooling: Global dotnet-format installation for formatting capabilities
  • Environment: Sets DOTNET_ROOT, DOTNET_CLI_TELEMETRY_OPTOUT, DOTNET_SKIP_FIRST_TIME_EXPERIENCE, DOTNET_NOLOGO
  • Validation: Build step verifies SDK configuration, version listing steps confirm installations
  • Security: Minimal contents: read permission
  • Triggers: Manual dispatch, auto-run on workflow file changes

Job Naming

Job named copilot-setup-steps per Copilot agent environment customization docs for agent recognition.

Cache Strategy

Cache keys use hash of packages.lock.json, *.fsproj, *.csproj files with OS-specific prefix for accurate invalidation across dependency updates.

Original prompt

This section details on the original issue you should resolve

<issue_title>Create Multi-Version .NET Setup Copilot Workflow</issue_title>
<issue_description># Create Multi-Version .NET Setup Copilot Workflow

Objective

Create a GitHub Actions workflow file that sets up a multi-version .NET environment for GitHub Copilot to work with .NET 6, 8, and 10 projects using best practices for security, performance, and maintainability.

Role

You are a DevOps engineer specializing in GitHub Actions and .NET CI/CD pipelines. Your task is to create a workflow that properly configures multiple .NET SDK versions following documented best practices.

Context

The workflow needs to be named copilot-setup-steps.yml and placed in .github/workflows/. It will automatically run when changed to validate the setup, and can be manually triggered through the Actions tab. The job must be named copilot-setup-steps to be recognized by Copilot. Docs: https://docs.github.com/en/copilot/how-tos/use-copilot-agents/coding-agent/customize-the-agent-environment

Requirements

  • Create a GitHub Actions workflow that sets up .NET 6.0, 8.0, and 10.0 SDKs in a single step using multi-version syntax
  • Use specific version numbers for reproducibility (not wildcards)
  • Include NuGet package caching for performance
  • Add .NET environment variables setup
  • Install dotnet-format tool for code formatting
  • Use minimum required permissions for security
  • Add proper validation and build steps

Instructions

Create a workflow file with the following structure:

  • Name: "Copilot Setup Steps for Multi-Version .NET"
  • Triggers: workflow_dispatch, push, and pull_request on the workflow file path
  • Job name: copilot-setup-steps
  • Runner: ubuntu-latest
  • Permissions: contents: read (minimum required)
  • Steps: checkout with full history, setup .NET SDKs (multi-version), cache NuGet packages, restore dependencies, install dotnet-format, set environment variables, build validation

Expected Output

The workflow should create a .github/workflows/copilot-setup-steps.yml file that:

  1. Sets up all three .NET SDK versions in a single step using proper multi-version syntax
  2. Uses specific version numbers (e.g., 6.0.428, 8.0.416, 10.0.101)
  3. Includes NuGet package caching for performance optimization
  4. Installs dotnet-format tool globally
  5. Sets up .NET environment variables (DOTNET_ROOT, DOTNET_CLI_TELEMETRY_OPTOUT)
  6. Includes build validation to ensure setup works correctly
  7. Uses proper GitHub Actions syntax with comments explaining each section
  8. Follows security best practices with minimal permissions

Acceptance Criteria

  • Workflow file is properly formatted YAML
  • All three .NET versions are configured in a single setup step using multi-version syntax
  • Specific version numbers are used (not wildcards)
  • NuGet caching is implemented with proper cache keys
  • dotnet-format tool installation step is included
  • Environment variables for .NET are configured
  • Build validation step is included to verify setup
  • Job is named copilot-setup-steps
  • Workflow triggers on appropriate events
  • Permissions are set to minimum required (contents: read)
  • Comments explain each section and security considerations
  • Follows best practices for reproducibility and performance
    </issue_description>

<agent_instructions>Solve this issue</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: dburriss <5071495+dburriss@users.noreply.github.com>
Copilot AI changed the title [WIP] Create multi-version .NET setup Copilot workflow Add Copilot multi-version .NET environment workflow Dec 11, 2025
Copilot AI requested a review from dburriss December 11, 2025 07:35
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.

Create Multi-Version .NET Setup Copilot Workflow

2 participants