From 8f903f0bca8182cb2eb9b5f2455abd36552726a0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 8 Jun 2026 16:14:37 +0000 Subject: [PATCH 1/3] Initial plan From aaa3297fba5c66e988566e840d2b135b8fa7dabd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 8 Jun 2026 16:19:46 +0000 Subject: [PATCH 2/3] Add CodeQL workflow with conditional Python analysis --- .github/workflows/codeql.yml | 57 ++++++++++++++++++++++++++++++++++++ 1 file changed, 57 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 00000000000..a439c113a16 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,57 @@ +name: "CodeQL" + +on: + push: + branches: ["main"] + pull_request: + branches: ["main"] + schedule: + - cron: "0 4 * * 0" + +jobs: + detect-languages: + name: Detect CodeQL languages + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Build language matrix + id: set-matrix + run: | + include='[{"language":"actions","build-mode":"none"}]' + + if git ls-files '*.py' | grep -q .; then + include='[{"language":"actions","build-mode":"none"},{"language":"python","build-mode":"none"}]' + fi + + echo "matrix={\"include\":$include}" >> "$GITHUB_OUTPUT" + + analyze: + name: Analyze (${{ matrix.language }}) + needs: detect-languages + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + strategy: + fail-fast: false + matrix: ${{ fromJSON(needs.detect-languages.outputs.matrix) }} + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v4 + with: + languages: ${{ matrix.language }} + build-mode: ${{ matrix['build-mode'] }} + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v4 + with: + category: /language:${{ matrix.language }} From 254a18627047e4e18bac6270de0fa29d79c80c07 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 8 Jun 2026 16:20:53 +0000 Subject: [PATCH 3/3] Set explicit default workflow permissions for CodeQL --- .github/workflows/codeql.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index a439c113a16..c1555839311 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -8,6 +8,9 @@ on: schedule: - cron: "0 4 * * 0" +permissions: + contents: read + jobs: detect-languages: name: Detect CodeQL languages