From f1a78767701787ff1b046d0687d07c0c278766e8 Mon Sep 17 00:00:00 2001 From: NomadsReach <144523850+NomadsReach@users.noreply.github.com> Date: Sun, 16 Aug 2026 17:46:35 -0400 Subject: [PATCH] Move DOTNET_INSTALL_DIR to step scope (runner context invalid at job env) The job-level env used runner.tool_cache, which isn't available until a runner is assigned, so the workflow failed to parse. Set it on the setup-dotnet step, where the runner context is valid. --- .github/workflows/csharp-server.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/csharp-server.yml b/.github/workflows/csharp-server.yml index 1d953de..396449b 100644 --- a/.github/workflows/csharp-server.yml +++ b/.github/workflows/csharp-server.yml @@ -9,10 +9,6 @@ jobs: build-and-test: name: Repository policy, C# build and test runs-on: [self-hosted, Linux, X64] - # The self-hosted runner user cannot write to the system /usr/share/dotnet, - # so install the pinned SDK into a runner-writable (and cached) path instead. - env: - DOTNET_INSTALL_DIR: ${{ runner.tool_cache }}/dotnet steps: - uses: actions/checkout@v4 @@ -20,6 +16,11 @@ jobs: run: bash server/scripts/verify-no-legacy-runtime.sh - uses: actions/setup-dotnet@v4 + # The runner user cannot write to system /usr/share/dotnet; install the + # pinned SDK into a runner-writable, cached path instead. runner.* context + # is only valid at step scope, not job-level env. + env: + DOTNET_INSTALL_DIR: ${{ runner.tool_cache }}/dotnet with: dotnet-version: "8.0.x"