diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh index b880b6188..2b877eef1 100755 --- a/.devcontainer/post-create.sh +++ b/.devcontainer/post-create.sh @@ -5,7 +5,13 @@ sudo apt-get update && \ sudo rm -rf /var/lib/apt/lists/* echo Install .NET dev certs -dotnet dev-certs https --trust +EXIT_CODE=0 +PARTIAL_TRUST_EXIT_CODE=4 # Exit code 4 indicates "partial trust" per aspnetcore#65391. +dotnet dev-certs https --trust || EXIT_CODE=$? +if [ "$EXIT_CODE" -ne 0 ] && [ "$EXIT_CODE" -ne "$PARTIAL_TRUST_EXIT_CODE" ]; then + echo "dotnet dev-certs https --trust failed with exit code $EXIT_CODE" + exit "$EXIT_CODE" +fi echo Install Aspire curl -sSL https://aspire.dev/install.sh | bash diff --git a/.github/actions/setup-runtimes-caching/action.yml b/.github/actions/setup-runtimes-caching/action.yml index 27c4edbf9..73349b920 100644 --- a/.github/actions/setup-runtimes-caching/action.yml +++ b/.github/actions/setup-runtimes-caching/action.yml @@ -85,7 +85,13 @@ runs: shell: bash if: ${{ matrix.os == 'ubuntu-latest' }} run: | - dotnet dev-certs https --trust + EXIT_CODE=0 + dotnet dev-certs https --trust || EXIT_CODE=$? + PARTIAL_TRUST_EXIT_CODE=4 # See aspnetcore#65391: exit code 4 indicates partial trust + if [ "$EXIT_CODE" -ne 0 ] && [ "$EXIT_CODE" -ne "$PARTIAL_TRUST_EXIT_CODE" ]; then + echo "dotnet dev-certs https --trust failed with exit code $EXIT_CODE" + exit "$EXIT_CODE" + fi - name: Setup Node globals shell: bash