Skip to content

Add conditional execution to .NET Core Desktop workflow#3

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/update-test-configuration
Draft

Add conditional execution to .NET Core Desktop workflow#3
Copilot wants to merge 2 commits intomainfrom
copilot/update-test-configuration

Conversation

Copy link
Copy Markdown

Copilot AI commented Jan 17, 2026

The workflow fails on repositories without .NET project files with MSBUILD : error MSB1003: Specify a project or solution file.

Changes

  • Added detection step to check for .NET project files (.csproj, .sln, .vbproj, .fsproj)
  • Gated all .NET build/test/package steps with conditional if: steps.check_dotnet.outputs.has_dotnet_files == 'true'
  • Workflow now completes successfully when no .NET projects exist
- name: Check for .NET project files
  id: check_dotnet
  shell: pwsh
  run: |
    $projectFiles = Get-ChildItem -Path . -Recurse -Include *.csproj,*.sln,*.vbproj,*.fsproj -ErrorAction SilentlyContinue
    if ($projectFiles.Count -gt 0) {
      echo "has_dotnet_files=true" >> $env:GITHUB_OUTPUT
    } else {
      echo "has_dotnet_files=false" >> $env:GITHUB_OUTPUT
    }

- name: Install .NET Core
  if: steps.check_dotnet.outputs.has_dotnet_files == 'true'
  uses: actions/setup-dotnet@v4
Original prompt

Reference: https://github.com/frozen9993-droid/228/actions/runs/21092638909/job/60666000781#step:1:1


💡 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: frozen9993-droid <254296743+frozen9993-droid@users.noreply.github.com>
Copilot AI changed the title [WIP] Update test configuration settings Add conditional execution to .NET Core Desktop workflow Jan 17, 2026
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.

2 participants