Skip to content

Commit 42d71a0

Browse files
Update CodeQL workflow to use latest actions
1 parent 1d357d5 commit 42d71a0

File tree

1 file changed

+48
-6
lines changed

1 file changed

+48
-6
lines changed

.github/workflows/codeql.yml

Lines changed: 48 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,77 @@ on:
77
branches: [ main ]
88
schedule:
99
- cron: '0 0 * * 1' # Every Monday at midnight
10+
workflow_dispatch:
1011

1112
jobs:
1213
analyze:
13-
name: 🔍 Analyze Code
14+
name: 🔍 Analyze ${{ matrix.language }}
1415
runs-on: ubuntu-latest
16+
1517
permissions:
1618
actions: read
1719
contents: read
1820
security-events: write
21+
packages: read
1922

2023
strategy:
2124
fail-fast: false
2225
matrix:
2326
language: [ 'csharp', 'javascript' ]
2427

2528
steps:
29+
# ========================================
30+
# 1️⃣ Checkout Repository
31+
# ========================================
2632
- name: 📥 Checkout repository
2733
uses: actions/checkout@v4
2834

35+
# ========================================
36+
# 2️⃣ Setup .NET (فقط برای C#)
37+
# ========================================
38+
- name: 🔧 Setup .NET
39+
if: matrix.language == 'csharp'
40+
uses: actions/setup-dotnet@v4
41+
with:
42+
dotnet-version: '7.0.x'
43+
44+
# ========================================
45+
# 3️⃣ Initialize CodeQL
46+
# ========================================
2947
- name: ⚙️ Initialize CodeQL
30-
uses: github/codeql-action/init@v2
48+
uses: github/codeql-action/init@v3
3149
with:
3250
languages: ${{ matrix.language }}
3351
queries: security-extended,security-and-quality
3452

35-
- name: 🏗️ Autobuild
36-
uses: github/codeql-action/autobuild@v2
53+
# ========================================
54+
# 4️⃣ Build Project (Manual - فقط برای C#)
55+
# ========================================
56+
- name: 🏗️ Build C# Projects
57+
if: matrix.language == 'csharp'
58+
run: |
59+
echo "📦 Restoring dependencies..."
60+
dotnet restore JsonViewer.Blazor.sln
61+
62+
echo "🏗️ Building Component..."
63+
dotnet build src/Component/Component.csproj -c Release --no-restore
64+
65+
echo "🏗️ Building Demo..."
66+
dotnet build src/Blazor.Demo/Blazor.Demo.csproj -c Release --no-restore
67+
68+
echo "✅ Build completed"
69+
70+
# ========================================
71+
# 5️⃣ Autobuild (فقط برای JavaScript)
72+
# ========================================
73+
- name: 🏗️ Autobuild JavaScript
74+
if: matrix.language == 'javascript'
75+
uses: github/codeql-action/autobuild@v3
3776

77+
# ========================================
78+
# 6️⃣ Perform CodeQL Analysis
79+
# ========================================
3880
- name: 🔍 Perform CodeQL Analysis
39-
uses: github/codeql-action/analyze@v2
81+
uses: github/codeql-action/analyze@v3
4082
with:
41-
category: "/language:${{matrix.language}}"
83+
category: "/language:${{ matrix.language }}"

0 commit comments

Comments
 (0)