Skip to content

Commit 8d375f4

Browse files
authored
Add CodeQL workflow configuration (#1962)
This pull request introduces a new GitHub Actions workflow to enable advanced CodeQL security analysis for the repository. The workflow is triggered on pushes, pull requests, and a weekly schedule, and it supports multiple languages. Security and CI improvements: * Added a `.github/workflows/codeql.yml` workflow that runs CodeQL analysis for `actions` and `python` code on main branch pushes, pull requests, and on a weekly schedule. The workflow checks out the code, initializes CodeQL for each language, and performs security analysis, with results uploaded to GitHub Security tab.
1 parent 100be88 commit 8d375f4

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/codeql.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: "CodeQL Advanced"
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
schedule:
9+
- cron: '18 3 * * 1'
10+
11+
jobs:
12+
analyze:
13+
name: Analyze (${{ matrix.language }})
14+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
15+
permissions:
16+
security-events: write
17+
packages: read
18+
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
include:
23+
- language: actions
24+
build-mode: none
25+
- language: python
26+
build-mode: none
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v4
30+
31+
- name: Initialize CodeQL
32+
uses: github/codeql-action/init@v4
33+
with:
34+
languages: ${{ matrix.language }}
35+
build-mode: ${{ matrix.build-mode }}
36+
37+
- name: Perform CodeQL Analysis
38+
uses: github/codeql-action/analyze@v4
39+
with:
40+
category: "/language:${{matrix.language}}"

0 commit comments

Comments
 (0)