Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: "Copilot Setup Steps"

# Allow testing of the setup steps from your repository's "Actions" tab.
on:
workflow_dispatch:

pull_request:
branches:
- master
paths:
- ".github/workflows/copilot-setup-steps.yml"

permissions:
contents: read

jobs:
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
# See https://docs.github.com/en/copilot/customizing-copilot/customizing-the-development-environment-for-copilot-coding-agent
copilot-setup-steps:
runs-on: ubuntu-latest

permissions:
contents: read

# You can define any steps you want, and they will run before the agent starts.
# If you do not check out your code, Copilot will do this for you.
steps:
- uses: actions/checkout@v6
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actions/checkout@v6 is the only usage of checkout v6 in this repo; other workflows use v4/v5 or pin to a specific commit SHA. Please align this workflow to an existing supported version (or a pinned SHA) to avoid failures if v6 is not available and to keep dependencies consistent across workflows.

Suggested change
- uses: actions/checkout@v6
- uses: actions/checkout@v5

Copilot uses AI. Check for mistakes.
with:
fetch-depth: 1000

- name: Bootstrap
if: success()
run: |-
$title = 'Import Build.psm1'
Write-Host "::group::$title"
Import-Module ./build.psm1 -Verbose -ErrorAction Stop
Write-LogGroupEnd -Title $title

$title = 'Switch to public feed'
Write-LogGroupStart -Title $title
Switch-PSNugetConfig -Source Public
Write-LogGroupEnd -Title $title

$title = 'Bootstrap'
Write-LogGroupStart -Title $title
Start-PSBootstrap -Scenario DotNet
Write-LogGroupEnd -Title $title

$title = 'Install .NET Tools'
Write-LogGroupStart -Title $title
Start-PSBootstrap -Scenario Tools
Write-LogGroupEnd -Title $title

$title = 'Sync Tags'
Write-LogGroupStart -Title $title
Sync-PSTags -AddRemoteIfMissing
Write-LogGroupEnd -Title $title

$title = 'Setup .NET environment variables'
Write-LogGroupStart -Title $title
Find-DotNet -SetDotnetRoot
Write-LogGroupEnd -Title $title
Comment on lines +37 to +63
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The log group started with Write-Host "::group::$title" isn't guaranteed to be closed if Import-Module fails (the ::endgroup:: is emitted after the failing command). Wrap the grouped block in try/finally so the ::endgroup:: (or equivalent) is always emitted even on errors.

Suggested change
Import-Module ./build.psm1 -Verbose -ErrorAction Stop
Write-LogGroupEnd -Title $title
$title = 'Switch to public feed'
Write-LogGroupStart -Title $title
Switch-PSNugetConfig -Source Public
Write-LogGroupEnd -Title $title
$title = 'Bootstrap'
Write-LogGroupStart -Title $title
Start-PSBootstrap -Scenario DotNet
Write-LogGroupEnd -Title $title
$title = 'Install .NET Tools'
Write-LogGroupStart -Title $title
Start-PSBootstrap -Scenario Tools
Write-LogGroupEnd -Title $title
$title = 'Sync Tags'
Write-LogGroupStart -Title $title
Sync-PSTags -AddRemoteIfMissing
Write-LogGroupEnd -Title $title
$title = 'Setup .NET environment variables'
Write-LogGroupStart -Title $title
Find-DotNet -SetDotnetRoot
Write-LogGroupEnd -Title $title
try {
Import-Module ./build.psm1 -Verbose -ErrorAction Stop
}
finally {
Write-Host "::endgroup::"
}
$title = 'Switch to public feed'
Write-LogGroupStart -Title $title
try {
Switch-PSNugetConfig -Source Public
}
finally {
Write-LogGroupEnd -Title $title
}
$title = 'Bootstrap'
Write-LogGroupStart -Title $title
try {
Start-PSBootstrap -Scenario DotNet
}
finally {
Write-LogGroupEnd -Title $title
}
$title = 'Install .NET Tools'
Write-LogGroupStart -Title $title
try {
Start-PSBootstrap -Scenario Tools
}
finally {
Write-LogGroupEnd -Title $title
}
$title = 'Sync Tags'
Write-LogGroupStart -Title $title
try {
Sync-PSTags -AddRemoteIfMissing
}
finally {
Write-LogGroupEnd -Title $title
}
$title = 'Setup .NET environment variables'
Write-LogGroupStart -Title $title
try {
Find-DotNet -SetDotnetRoot
}
finally {
Write-LogGroupEnd -Title $title
}

Copilot uses AI. Check for mistakes.
Comment on lines +36 to +63
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each Write-LogGroupStart should be paired with a guaranteed Write-LogGroupEnd even when a command inside the group throws (e.g., Switch-PSNugetConfig, Start-PSBootstrap). Consider wrapping each grouped section in try/finally so a failure doesn't leave the remainder of the job output collapsed inside an unclosed group.

Suggested change
Write-Host "::group::$title"
Import-Module ./build.psm1 -Verbose -ErrorAction Stop
Write-LogGroupEnd -Title $title
$title = 'Switch to public feed'
Write-LogGroupStart -Title $title
Switch-PSNugetConfig -Source Public
Write-LogGroupEnd -Title $title
$title = 'Bootstrap'
Write-LogGroupStart -Title $title
Start-PSBootstrap -Scenario DotNet
Write-LogGroupEnd -Title $title
$title = 'Install .NET Tools'
Write-LogGroupStart -Title $title
Start-PSBootstrap -Scenario Tools
Write-LogGroupEnd -Title $title
$title = 'Sync Tags'
Write-LogGroupStart -Title $title
Sync-PSTags -AddRemoteIfMissing
Write-LogGroupEnd -Title $title
$title = 'Setup .NET environment variables'
Write-LogGroupStart -Title $title
Find-DotNet -SetDotnetRoot
Write-LogGroupEnd -Title $title
Write-LogGroupStart -Title $title
try {
Import-Module ./build.psm1 -Verbose -ErrorAction Stop
}
finally {
Write-LogGroupEnd -Title $title
}
$title = 'Switch to public feed'
Write-LogGroupStart -Title $title
try {
Switch-PSNugetConfig -Source Public
}
finally {
Write-LogGroupEnd -Title $title
}
$title = 'Bootstrap'
Write-LogGroupStart -Title $title
try {
Start-PSBootstrap -Scenario DotNet
}
finally {
Write-LogGroupEnd -Title $title
}
$title = 'Install .NET Tools'
Write-LogGroupStart -Title $title
try {
Start-PSBootstrap -Scenario Tools
}
finally {
Write-LogGroupEnd -Title $title
}
$title = 'Sync Tags'
Write-LogGroupStart -Title $title
try {
Sync-PSTags -AddRemoteIfMissing
}
finally {
Write-LogGroupEnd -Title $title
}
$title = 'Setup .NET environment variables'
Write-LogGroupStart -Title $title
try {
Find-DotNet -SetDotnetRoot
}
finally {
Write-LogGroupEnd -Title $title
}

Copilot uses AI. Check for mistakes.
shell: pwsh
3 changes: 3 additions & 0 deletions .github/workflows/windows-packaging-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ env:
SYSTEM_ARTIFACTSDIRECTORY: ${{ github.workspace }}/artifacts
BUILD_ARTIFACTSTAGINGDIRECTORY: ${{ github.workspace }}/artifacts

permissions:
contents: read

jobs:
package:
name: ${{ matrix.architecture }} - ${{ matrix.channel }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/xunit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ on:
required: false
default: testResults-xunit

permissions:
contents: read

jobs:
xunit:
name: Run xUnit Tests
Expand Down
Loading