Skip to content

Commit f2a1e9b

Browse files
authored
feat: install .NET SDK 9.0.x using custom script for self-hosted runners
1 parent 370768b commit f2a1e9b

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

.github/workflows/azure-dev.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,21 @@ jobs:
8686
echo "GitLeaks scan completed"
8787
8888
- name: Setup .NET SDK
89-
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
90-
with:
91-
dotnet-version: '9.0.x'
92-
# Use local installation directory for self-hosted runners to avoid permission issues
93-
dotnet-install-dir: ${{ runner.temp }}/dotnet
89+
shell: bash
90+
run: |
91+
# Install .NET SDK to temp directory for self-hosted runners to avoid permission issues
92+
DOTNET_INSTALL_DIR="${{ runner.temp }}/dotnet"
93+
mkdir -p "$DOTNET_INSTALL_DIR"
94+
95+
# Download and run the dotnet-install script
96+
curl -sSL https://dot.net/v1/dotnet-install.sh -o dotnet-install.sh
97+
chmod +x dotnet-install.sh
98+
./dotnet-install.sh --channel 9.0 --install-dir "$DOTNET_INSTALL_DIR"
99+
rm dotnet-install.sh
100+
101+
# Add to PATH for subsequent steps
102+
echo "$DOTNET_INSTALL_DIR" >> $GITHUB_PATH
103+
echo "DOTNET_ROOT=$DOTNET_INSTALL_DIR" >> $GITHUB_ENV
94104
95105
- name: Install Power Platform Tools
96106
uses: microsoft/powerplatform-actions/actions-install@6c7b538671a040d11afd8ab94d77bfe3b3ed87e6 # v1.9.1

0 commit comments

Comments
 (0)