From 15530a5ae95fd2c7dc7afacc18afa8dc58301a0e Mon Sep 17 00:00:00 2001 From: SpicyCoder Date: Sat, 20 Jun 2026 12:16:37 +0530 Subject: [PATCH 1/3] ci: add CodeQL security scanning --- .github/workflows/codeql.yml | 58 ++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..8fdca2d --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,58 @@ +name: CodeQL + +on: + push: + branches: [main] + pull_request: + branches: [main] + schedule: + - cron: '0 6 * * 1' + +jobs: + analyze: + name: Analyze (${{ matrix.language }}) + runs-on: ubuntu-latest + permissions: + security-events: write + + strategy: + fail-fast: false + matrix: + include: + - language: csharp + build-mode: build + - language: javascript-typescript + build-mode: none + + steps: + - uses: actions/checkout@v4 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + build-mode: ${{ matrix.build-mode }} + + - if: matrix.build-mode == 'build' + name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 10.0.x + + - if: matrix.build-mode == 'build' + run: dotnet workload install aspire + + - if: matrix.build-mode == 'build' + run: dotnet tool restore + + - if: matrix.build-mode == 'build' + run: dotnet restore ./ScrumPoker.slnx + + - if: matrix.build-mode == 'build' + name: Build .NET + run: dotnet build --no-restore -c Release ./ScrumPoker.slnx + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{ matrix.language }}" From 9012ad8e73cbe32e5873b0f3ba1dbda63184a80f Mon Sep 17 00:00:00 2001 From: SpicyCoder Date: Sat, 20 Jun 2026 12:22:09 +0530 Subject: [PATCH 2/3] ci: fix CodeQL build mode and upgrade to v4 --- .github/workflows/codeql.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 8fdca2d..e2ac5bb 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -20,7 +20,7 @@ jobs: matrix: include: - language: csharp - build-mode: build + build-mode: autobuild - language: javascript-typescript build-mode: none @@ -28,31 +28,31 @@ jobs: - uses: actions/checkout@v4 - name: Initialize CodeQL - uses: github/codeql-action/init@v3 + uses: github/codeql-action/init@v4 with: languages: ${{ matrix.language }} build-mode: ${{ matrix.build-mode }} - - if: matrix.build-mode == 'build' + - if: matrix.build-mode == 'autobuild' name: Setup .NET uses: actions/setup-dotnet@v4 with: dotnet-version: 10.0.x - - if: matrix.build-mode == 'build' + - if: matrix.build-mode == 'autobuild' run: dotnet workload install aspire - - if: matrix.build-mode == 'build' + - if: matrix.build-mode == 'autobuild' run: dotnet tool restore - - if: matrix.build-mode == 'build' + - if: matrix.build-mode == 'autobuild' run: dotnet restore ./ScrumPoker.slnx - - if: matrix.build-mode == 'build' + - if: matrix.build-mode == 'autobuild' name: Build .NET run: dotnet build --no-restore -c Release ./ScrumPoker.slnx - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 + uses: github/codeql-action/analyze@v4 with: category: "/language:${{ matrix.language }}" From a2f8f2a1651270daa5d24c327ff26fb5539433d4 Mon Sep 17 00:00:00 2001 From: SpicyCoder Date: Sat, 20 Jun 2026 12:34:41 +0530 Subject: [PATCH 3/3] ci: restrict publish to main branch only --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5a5e744..931460d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -89,7 +89,7 @@ jobs: name: Publish containers runs-on: ubuntu-latest needs: build - if: github.event_name == 'push' + if: github.event_name == 'push' && github.ref == 'refs/heads/main' permissions: contents: read packages: write