Skip to content

Commit ba64ac1

Browse files
authored
[Core] Fix CodeQL (#4315)
1 parent b77b530 commit ba64ac1

File tree

2 files changed

+24
-3
lines changed

2 files changed

+24
-3
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,15 @@ jobs:
3838
- name: Checkout repository
3939
uses: actions/checkout@v3
4040

41+
- name: Update TargetFrameworks to net9.0
42+
shell: pwsh
43+
run: |
44+
.\.github\workflows\update-target-frameworks.ps1 -newTarget "net9.0"
45+
4146
- name: Setup .NET
4247
uses: actions/setup-dotnet@v4
4348
with:
44-
dotnet-version: 10.0.x
45-
dotnet-quality: preview
49+
dotnet-version: 9.0.x
4650

4751
- name: Initialize CodeQL
4852
uses: github/codeql-action/init@v3
@@ -52,7 +56,7 @@ jobs:
5256
- if: matrix.language == 'csharp'
5357
name: Manually build CSharp on .NET
5458
run: |
55-
dotnet build Microsoft.FluentUI.sln
59+
dotnet build Microsoft.FluentUI.sln -c Release
5660
5761
- name: Perform CodeQL Analysis
5862
uses: github/codeql-action/analyze@v3
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
param(
2+
[Parameter(Mandatory=$true)]
3+
[string]$newTarget
4+
)
5+
6+
Write-Host "Updating TargetFrameworks to $newTarget..."
7+
8+
Get-ChildItem -Recurse -Filter *.csproj | ForEach-Object {
9+
$content = Get-Content $_.FullName -Raw
10+
if ($content -match '<TargetFrameworks>.*?</TargetFrameworks>') {
11+
$content = $content -replace '<TargetFrameworks>.*?</TargetFrameworks>', "<TargetFrameworks>$newTarget</TargetFrameworks>"
12+
Set-Content -Path $_.FullName -Value $content -NoNewline
13+
Write-Host "Updated $($_.FullName)"
14+
}
15+
}
16+
17+
Write-Host "Done updating TargetFrameworks."

0 commit comments

Comments
 (0)