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
|
required: false
|
||||||
default: "Release"
|
default: "Release"
|
||||||
type: string
|
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:
|
warnaserror:
|
||||||
description: "Treat build warnings as errors (\"true\"/\"false\")"
|
description: "Treat build warnings as errors (\"true\"/\"false\")"
|
||||||
required: false
|
required: false
|
||||||
@@ -101,9 +101,11 @@ jobs:
|
|||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
ARGS=(-c "$CONFIGURATION" --no-restore)
|
ARGS=(-c "$CONFIGURATION" --no-restore)
|
||||||
if [ "${WARNASERROR,,}" != "false" ]; then
|
# act_runner may deliver the value mangled as '%!t(string=false)', so match by substring.
|
||||||
ARGS+=(-warnaserror)
|
case "${WARNASERROR,,}" in
|
||||||
fi
|
*false*) ;;
|
||||||
|
*) ARGS+=(-warnaserror) ;;
|
||||||
|
esac
|
||||||
set -x
|
set -x
|
||||||
dotnet build ${SOLUTION:+"$SOLUTION"} "${ARGS[@]}"
|
dotnet build ${SOLUTION:+"$SOLUTION"} "${ARGS[@]}"
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ on:
|
|||||||
required: false
|
required: false
|
||||||
default: "Release"
|
default: "Release"
|
||||||
type: string
|
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:
|
warnaserror:
|
||||||
description: "Treat build warnings as errors (\"true\"/\"false\")"
|
description: "Treat build warnings as errors (\"true\"/\"false\")"
|
||||||
required: false
|
required: false
|
||||||
@@ -66,9 +66,11 @@ jobs:
|
|||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
ARGS=(-c "$CONFIGURATION" --no-restore)
|
ARGS=(-c "$CONFIGURATION" --no-restore)
|
||||||
if [ "${WARNASERROR,,}" != "false" ]; then
|
# act_runner may deliver the value mangled as '%!t(string=false)', so match by substring.
|
||||||
ARGS+=(-warnaserror)
|
case "${WARNASERROR,,}" in
|
||||||
fi
|
*false*) ;;
|
||||||
|
*) ARGS+=(-warnaserror) ;;
|
||||||
|
esac
|
||||||
set -x
|
set -x
|
||||||
dotnet build ${SOLUTION:+"$SOLUTION"} "${ARGS[@]}"
|
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. |
|
| `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 |
|
| `dotnet-version` | `10.0.x` | .NET SDK version |
|
||||||
| `configuration` | `Release` | Build configuration |
|
| `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 |
|
| `working-directory` | `.` | Where dotnet commands run |
|
||||||
| `test-filter` | `""` | Optional `dotnet test --filter` expression |
|
| `test-filter` | `""` | Optional `dotnet test --filter` expression |
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user