configure the proper copilot agent workflow by creating the proper file - you control which OS the Copilot Agent runs on by choosing the runner in the GitHub Actions workflow the agent uses. Change the job's runs-on to a Windows runner (GitHub-hosted: windows-latest / windows-2022) or point it at a self-hosted Windows runner by using its labels (self-hosted + your custom label). If the agent is generating workflows automatically, add or override the workflow with one that forces a Windows runner.
What to do (two common approaches)
- Use GitHub-hosted Windows runner
- Edit/create the Actions workflow the agent uses and set runs-on: windows-latest.
- Example workflow (create at .github/workflows/copilot-agent-windows.yml):
name: Copilot Agent — Windows runner example
on:
workflow_dispatch:
jobs:
copilot-agent-task:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run agent task (placeholder)
shell: pwsh
run: |
Write-Host "Running Copilot Agent job on Windows"
# put the commands the agent expects to run here
- Use a self-hosted Windows runner (recommended when you need specific software, Windows containers, or hardware)
- Install/register a self-hosted runner on a Windows machine (Repo Settings → Actions → Runners → Add runner) and give it a custom label (for example: copilot-windows).
- Target that label in your workflow:
name: Copilot Agent — Self-hosted Windows runner
on:
workflow_dispatch:
jobs:
copilot-agent-task:
runs-on: [self-hosted, windows, x64, copilot-windows]
steps:
- uses: actions/checkout@v4
- name: Run agent task (placeholder)
shell: pwsh
run: |
Write-Host "Running on self-hosted Windows runner"
# commands here
Notes, gotchas and debugging tips
-
If Copilot Agents re-generate workflows, create a named workflow file with the exact job you want so it takes precedence; otherwise auto-generated flows might continue to specify ubuntu/ubuntu-latest.
-
Windows differences: many CLI tools and Docker workflows behave differently on Windows. If the agent expects Linux containers or POSIX shell, you may need to adjust commands (use pwsh or cmd).
-
Windows GitHub-hosted image is windows-latest (Windows Server 2022). If you need older/newer OS check the Actions docs for exact image names.
-
If your job still runs on Linux: open the run's Details → Job → Runner to see which labels matched; logs show the runner selected and any label mismatch.
-
If the Copilot Agent feature itself has a UI/agent config that chooses runners, look for a runner/label option there and set it to your Windows label — but the workflow-level runs-on is the definitive control.
-
add a workflow file to this repo that forces a Windows runner
configure the proper copilot agent workflow by creating the proper file - you control which OS the Copilot Agent runs on by choosing the runner in the GitHub Actions workflow the agent uses. Change the job's runs-on to a Windows runner (GitHub-hosted: windows-latest / windows-2022) or point it at a self-hosted Windows runner by using its labels (self-hosted + your custom label). If the agent is generating workflows automatically, add or override the workflow with one that forces a Windows runner.
What to do (two common approaches)
Notes, gotchas and debugging tips
If Copilot Agents re-generate workflows, create a named workflow file with the exact job you want so it takes precedence; otherwise auto-generated flows might continue to specify ubuntu/ubuntu-latest.
Windows differences: many CLI tools and Docker workflows behave differently on Windows. If the agent expects Linux containers or POSIX shell, you may need to adjust commands (use pwsh or cmd).
Windows GitHub-hosted image is windows-latest (Windows Server 2022). If you need older/newer OS check the Actions docs for exact image names.
If your job still runs on Linux: open the run's Details → Job → Runner to see which labels matched; logs show the runner selected and any label mismatch.
If the Copilot Agent feature itself has a UI/agent config that chooses runners, look for a runner/label option there and set it to your Windows label — but the workflow-level runs-on is the definitive control.
add a workflow file to this repo that forces a Windows runner