From abae2128138e6f7348ed429c68f7f545019f6461 Mon Sep 17 00:00:00 2001 From: UltimateCoder Date: Thu, 15 Oct 2026 22:30:46 +0200 Subject: [PATCH] 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 --- .gitea/workflows/dotnet-build-test-postgres.yaml | 10 ++++++---- .gitea/workflows/dotnet-build-test.yaml | 10 ++++++---- README.md | 2 +- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.gitea/workflows/dotnet-build-test-postgres.yaml b/.gitea/workflows/dotnet-build-test-postgres.yaml index d08c2ab..b3bee4c 100644 --- a/.gitea/workflows/dotnet-build-test-postgres.yaml +++ b/.gitea/workflows/dotnet-build-test-postgres.yaml @@ -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. diff --git a/.gitea/workflows/dotnet-build-test.yaml b/.gitea/workflows/dotnet-build-test.yaml index 2fd7731..ccee438 100644 --- a/.gitea/workflows/dotnet-build-test.yaml +++ b/.gitea/workflows/dotnet-build-test.yaml @@ -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 diff --git a/README.md b/README.md index 96b79f2..313641a 100644 --- a/README.md +++ b/README.md @@ -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 |