Skip to content

Commit

Permalink
feat: add more validation for build-config workflow input
Browse files Browse the repository at this point in the history
  • Loading branch information
CalvinWilkinson committed Sep 25, 2023
1 parent 9c1ff9a commit 3e801f5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/build-csharp-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ jobs:
}
if ("${{ inputs.build-config }}" -ne "Debug" -and "${{ inputs.build-config }}" -ne "Release") {
Write-Host "::error::The 'build-config' workflow input is invalid. Expected values: 'Debug' or 'Release'";
exit 1;
}
# Verify that the dotnet sdk version has valid syntax
if ($sdkVersion -match "[0-9]+\.[0-9]+\.[0-9]+") {
Write-Host "::notice::The 'net-sdk-version' workflow input is valid.";
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/run-csharp-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ jobs:
}
if ("${{ inputs.build-config }}" -ne "Debug" -and "${{ inputs.build-config }}" -ne "Release") {
Write-Host "::error::The 'build-config' workflow input is invalid. Expected values: 'Debug' or 'Release'";
exit 1;
}
$sdkVersion = "${{ inputs.net-sdk-version }}".Trim().ToLower();
# Verify that the dotnet sdk version has valid syntax
Expand Down

0 comments on commit 3e801f5

Please sign in to comment.