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 |