fix: let warnaserror "false" disable -warnaserror
Even as a string input, act_runner delivers the value as '%!t(string=false)', so an exact comparison never matches. Match case-insensitively on the substring "false" instead. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
abae212813
commit
67b6a24726
3 files changed
+13
-9
No files matched your search
@@ -18,7 +18,7 @@ on:
|
||||
required: false
|
||||
default: "Release"
|
||||
type: string
|
||||
# string, not boolean: act_runner mangles boolean defaults (format() yields '%!t(string=false)').
|
||||
# string, not boolean: act_runner mangles boolean defaults. The value may still arrive as '%!t(string=…)', see Build step.
|
||||
warnaserror:
|
||||
description: "Treat build warnings as errors (\"true\"/\"false\")"
|
||||
required: false
|
||||
@@ -101,9 +101,11 @@ jobs:
|
||||
- name: Build
|
||||
run: |
|
||||
ARGS=(-c "$CONFIGURATION" --no-restore)
|
||||
if [ "${WARNASERROR,,}" != "false" ]; then
|
||||
ARGS+=(-warnaserror)
|
||||
fi
|
||||
# act_runner may deliver the value mangled as '%!t(string=false)', so match by substring.
|
||||
case "${WARNASERROR,,}" in
|
||||
*false*) ;;
|
||||
*) ARGS+=(-warnaserror) ;;
|
||||
esac
|
||||
set -x
|
||||
dotnet build ${SOLUTION:+"$SOLUTION"} "${ARGS[@]}"
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ on:
|
||||
required: false
|
||||
default: "Release"
|
||||
type: string
|
||||
# string, not boolean: act_runner mangles boolean defaults (format() yields '%!t(string=false)').
|
||||
# string, not boolean: act_runner mangles boolean defaults. The value may still arrive as '%!t(string=…)', see Build step.
|
||||
warnaserror:
|
||||
description: "Treat build warnings as errors (\"true\"/\"false\")"
|
||||
required: false
|
||||
@@ -66,9 +66,11 @@ jobs:
|
||||
- name: Build
|
||||
run: |
|
||||
ARGS=(-c "$CONFIGURATION" --no-restore)
|
||||
if [ "${WARNASERROR,,}" != "false" ]; then
|
||||
ARGS+=(-warnaserror)
|
||||
fi
|
||||
# act_runner may deliver the value mangled as '%!t(string=false)', so match by substring.
|
||||
case "${WARNASERROR,,}" in
|
||||
*false*) ;;
|
||||
*) ARGS+=(-warnaserror) ;;
|
||||
esac
|
||||
set -x
|
||||
dotnet build ${SOLUTION:+"$SOLUTION"} "${ARGS[@]}"
|
||||
|
||||
|
||||
@@ -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` unless the value is `"false"` |
|
||||
| `warnaserror` | `"true"` | Pass `-warnaserror` to `dotnet build` unless the value contains `false` |
|
||||
| `working-directory` | `.` | Where dotnet commands run |
|
||||
| `test-filter` | `""` | Optional `dotnet test --filter` expression |
|
||||
|
||||
|
||||
Reference in new issue
Block a user