|
7 | 7 | branches: [ main ] |
8 | 8 | schedule: |
9 | 9 | - cron: '0 0 * * 1' # Every Monday at midnight |
| 10 | + workflow_dispatch: |
10 | 11 |
|
11 | 12 | jobs: |
12 | 13 | analyze: |
13 | | - name: 🔍 Analyze Code |
| 14 | + name: 🔍 Analyze ${{ matrix.language }} |
14 | 15 | runs-on: ubuntu-latest |
| 16 | + |
15 | 17 | permissions: |
16 | 18 | actions: read |
17 | 19 | contents: read |
18 | 20 | security-events: write |
| 21 | + packages: read |
19 | 22 |
|
20 | 23 | strategy: |
21 | 24 | fail-fast: false |
22 | 25 | matrix: |
23 | 26 | language: [ 'csharp', 'javascript' ] |
24 | 27 |
|
25 | 28 | steps: |
| 29 | + # ======================================== |
| 30 | + # 1️⃣ Checkout Repository |
| 31 | + # ======================================== |
26 | 32 | - name: 📥 Checkout repository |
27 | 33 | uses: actions/checkout@v4 |
28 | 34 |
|
| 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 | + # ======================================== |
29 | 47 | - name: ⚙️ Initialize CodeQL |
30 | | - uses: github/codeql-action/init@v2 |
| 48 | + uses: github/codeql-action/init@v3 |
31 | 49 | with: |
32 | 50 | languages: ${{ matrix.language }} |
33 | 51 | queries: security-extended,security-and-quality |
34 | 52 |
|
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 |
37 | 76 |
|
| 77 | + # ======================================== |
| 78 | + # 6️⃣ Perform CodeQL Analysis |
| 79 | + # ======================================== |
38 | 80 | - name: 🔍 Perform CodeQL Analysis |
39 | | - uses: github/codeql-action/analyze@v2 |
| 81 | + uses: github/codeql-action/analyze@v3 |
40 | 82 | with: |
41 | | - category: "/language:${{matrix.language}}" |
| 83 | + category: "/language:${{ matrix.language }}" |
0 commit comments