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

Comment on lines +22 to +24
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 workflow sets permissions: contents: read at both the workflow level and again at the job level. The job-level block is redundant unless you intend to override permissions per-job; consider removing it to reduce duplication.

Suggested change
permissions:
contents: read

Copilot uses AI. Check for mistakes.
# 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
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
Comment on lines +37 to +38
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 first log group is started with a raw workflow command, but if Import-Module ./build.psm1 -ErrorAction Stop fails the step will exit before emitting ::endgroup::, leaving the GitHub Actions log group unclosed. Consider wrapping the import in a try/finally (emitting ::endgroup:: in finally) so the group is always closed even on failure.

Suggested change
Import-Module ./build.psm1 -Verbose -ErrorAction Stop
Write-LogGroupEnd -Title $title
try {
Import-Module ./build.psm1 -Verbose -ErrorAction Stop
}
finally {
Write-Host "::endgroup::"
}

Copilot uses AI. Check for mistakes.

$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.

Each Write-LogGroupStart/Write-LogGroupEnd pair here can be left unclosed if the command inside the group throws (e.g., Switch-PSNugetConfig, Start-PSBootstrap, Sync-PSTags, Find-DotNet). Consider wrapping each grouped operation in try/finally (or using a small helper pattern) so the ::endgroup:: marker is always emitted on error for cleaner CI logs.

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.
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