fix: apply -warnaserror reliably

act_runner mangles boolean input defaults: format('{0}', inputs.warnaserror)
evaluated to '%!t(string=false)', so -warnaserror was never passed.
Input is now a string defaulting to "true"; anything but "false" enables it.
Build command is traced (set -x) so the log shows the flags used.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
UltimateCoderandClaude Opus 5.5 committed 2026-10-15 22:30:46 +02:00
1 parent cdd0db3c65
commit abae212813
3 files changed
+13 -9

No files matched your search

@@ -18,11 +18,12 @@ on:
required: false
default: "Release"
type: string
# string, not boolean: act_runner mangles boolean defaults (format() yields '%!t(string=false)').
warnaserror:
description: "Treat build warnings as errors"
description: "Treat build warnings as errors (\"true\"/\"false\")"
required: false
default: true
type: boolean
default: "true"
type: string
working-directory:
description: "Path where dotnet commands are executed (relative to repo root)"
required: false
@@ -100,9 +101,10 @@ jobs:
- name: Build
run: |
ARGS=(-c "$CONFIGURATION" --no-restore)
if [ "$WARNASERROR" = "true" ]; then
if [ "${WARNASERROR,,}" != "false" ]; then
ARGS+=(-warnaserror)
fi
set -x
dotnet build ${SOLUTION:+"$SOLUTION"} "${ARGS[@]}"
# The image's init phase listens on the unix socket only, so an open TCP port means the final server is up.
+6 -4
View File
@@ -18,11 +18,12 @@ on:
required: false
default: "Release"
type: string
# string, not boolean: act_runner mangles boolean defaults (format() yields '%!t(string=false)').
warnaserror:
description: "Treat build warnings as errors"
description: "Treat build warnings as errors (\"true\"/\"false\")"
required: false
default: true
type: boolean
default: "true"
type: string
working-directory:
description: "Path where dotnet commands are executed (relative to repo root)"
required: false
@@ -65,9 +66,10 @@ jobs:
- name: Build
run: |
ARGS=(-c "$CONFIGURATION" --no-restore)
if [ "$WARNASERROR" = "true" ]; then
if [ "${WARNASERROR,,}" != "false" ]; then
ARGS+=(-warnaserror)
fi
set -x
dotnet build ${SOLUTION:+"$SOLUTION"} "${ARGS[@]}"
- name: Test
+1 -1
View File
@@ -27,7 +27,7 @@ jobs:
| `solution` | `""` | Solution/project file, relative to `working-directory`. If empty, dotnet uses the single sln/proj in that directory. |
| `dotnet-version` | `10.0.x` | .NET SDK version |
| `configuration` | `Release` | Build configuration |
| `warnaserror` | `true` | Pass `-warnaserror` to `dotnet build` |
| `warnaserror` | `"true"` | Pass `-warnaserror` to `dotnet build` unless the value is `"false"` |
| `working-directory` | `.` | Where dotnet commands run |
| `test-filter` | `""` | Optional `dotnet test --filter` expression |