Skip to content

Fix CodeQL workflow: add setup-dotnet for C# autobuild on Windows#310

Merged
shibayan merged 3 commits intoshibayan-patch-1from
copilot/sub-pr-309
Mar 6, 2026
Merged

Fix CodeQL workflow: add setup-dotnet for C# autobuild on Windows#310
shibayan merged 3 commits intoshibayan-patch-1from
copilot/sub-pr-309

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 6, 2026

The CodeQL workflow was missing a .NET SDK setup step, causing C# autobuild to fail on a fresh runner. The project targets net10.0-windows (WPF), which also requires a Windows runner.

Changes

  • Runner: runs-on updated to select windows-latest for csharp matrix entry
  • SDK setup: Added actions/setup-dotnet step gated to matrix.language == 'csharp', using shared DOTNET_VERSION: 10.0.x env var
  • Action pinning: actions/checkout and actions/setup-dotnet pinned to full commit SHAs, consistent with build.yml and publish.yml
env:
  DOTNET_VERSION: 10.0.x

runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || (matrix.language == 'csharp' && 'windows-latest') || 'ubuntu-latest' }}

- name: Use .NET ${{ env.DOTNET_VERSION }}
  if: matrix.language == 'csharp'
  uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0
  with:
    dotnet-version: ${{ env.DOTNET_VERSION }}

💡 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: shibayan <1356444+shibayan@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor CodeQL workflow for clarity improvements Fix CodeQL workflow: add setup-dotnet for C# autobuild on Windows Mar 6, 2026
@shibayan shibayan marked this pull request as ready for review March 6, 2026 07:44
@shibayan shibayan merged commit fec14f7 into shibayan-patch-1 Mar 6, 2026
@shibayan shibayan deleted the copilot/sub-pr-309 branch March 6, 2026 07:45
shibayan added a commit that referenced this pull request Mar 6, 2026
* Refactor CodeQL workflow for improved clarity

Updated CodeQL workflow to include autobuild mode and removed unnecessary comments.

* Fix CodeQL C# analysis to run on Windows (#312)

* Initial plan

* Fix CodeQL workflow to use windows-latest for C# analysis

Co-authored-by: shibayan <1356444+shibayan@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: shibayan <1356444+shibayan@users.noreply.github.com>

* Pin codeql.yml actions to full commit SHAs (#311)

* Initial plan

* Pin codeql.yml actions to full commit SHAs for supply chain hardening

Co-authored-by: shibayan <1356444+shibayan@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: shibayan <1356444+shibayan@users.noreply.github.com>

* Fix CodeQL workflow: add setup-dotnet for C# autobuild on Windows (#310)

* Initial plan

* Add setup-dotnet step to CodeQL workflow for C# autobuild

Co-authored-by: shibayan <1356444+shibayan@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: shibayan <1356444+shibayan@users.noreply.github.com>
Co-authored-by: Tatsuro Shibamura <me@shibayan.jp>

---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: shibayan <1356444+shibayan@users.noreply.github.com>
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