From 681c96d1afda306b596f6e085e8099490cfaebe9 Mon Sep 17 00:00:00 2001 From: Rafael Vuijk Date: Fri, 7 Aug 2026 00:56:36 +0000 Subject: [PATCH] Splat build.ps1 arguments as a hashtable so the dispatch inputs work The workflow_dispatch inputs have no effect except to break the run. Array splatting binds positionally, and build.ps1 declares only switches with no positional parameters, so any non-default input fails the build immediately: build.ps1: A positional parameter cannot be found that accepts argument '-SkipCoverage'. Only the all-defaults path works today, because that leaves the array empty. Splatting a hashtable binds by parameter name instead. This is invisible on push and pull_request, which never populate the inputs, so it only bites someone dispatching the workflow by hand -- which is also the only way to get a matrix run on a branch with no pull request open. --- .github/workflows/ci.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1e00d266c5..6f63b4e176 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -81,11 +81,14 @@ jobs: PACK_NUGETS: ${{ github.event_name != 'workflow_dispatch' || inputs.pack_nugets || inputs.publish_nuget }} CREATE_ARCHIVE: ${{ github.event_name != 'workflow_dispatch' || inputs.upload_artifacts }} run: | - $buildArguments = @() - if ($env:RUN_TESTS -ne 'true') { $buildArguments += '-SkipTests' } - if ($env:COLLECT_COVERAGE -ne 'true') { $buildArguments += '-SkipCoverage' } - if ($env:PACK_NUGETS -ne 'true') { $buildArguments += '-SkipPack' } - if ($env:CREATE_ARCHIVE -ne 'true') { $buildArguments += '-SkipArchive' } + # Splat a hashtable, not an array. Array splatting binds positionally, and + # build.ps1 declares only switches, so any non-empty array fails with + # "A positional parameter cannot be found that accepts argument '-SkipTests'". + $buildArguments = @{} + if ($env:RUN_TESTS -ne 'true') { $buildArguments['SkipTests'] = $true } + if ($env:COLLECT_COVERAGE -ne 'true') { $buildArguments['SkipCoverage'] = $true } + if ($env:PACK_NUGETS -ne 'true') { $buildArguments['SkipPack'] = $true } + if ($env:CREATE_ARCHIVE -ne 'true') { $buildArguments['SkipArchive'] = $true } ./Build/build.ps1 @buildArguments # Codecov intermittently fails while importing its verification key from Keybase.