Skip to content

Commit ee267e7

Browse files
feat(dir-sdk-python): add CodeQL
Signed-off-by: Bendegúz Csirmaz <csirmazbendeguz@gmail.com>
1 parent 887ccaf commit ee267e7

1 file changed

Lines changed: 84 additions & 0 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Copyright AGNTCY Contributors (https://github.com/agntcy)
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
name: "CodeQL Advanced"
5+
6+
on:
7+
push:
8+
branches: ["main"]
9+
pull_request:
10+
branches: ["main"]
11+
schedule:
12+
- cron: "42 5 * * 6"
13+
workflow_dispatch:
14+
15+
jobs:
16+
analyze:
17+
name: Analyze
18+
# Runner size impacts CodeQL analysis time. To learn more, please see:
19+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
20+
# - https://gh.io/supported-runners-and-hardware-resources
21+
# - https://gh.io/using-larger-runners (GitHub.com only)
22+
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
23+
runs-on: ubuntu-latest
24+
permissions:
25+
# required for all workflows
26+
security-events: write
27+
28+
# required to fetch internal or private CodeQL packs
29+
packages: read
30+
31+
# only required for workflows in private repositories
32+
actions: read
33+
contents: read
34+
35+
steps:
36+
- name: Checkout repository
37+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
38+
39+
- name: Set up Python
40+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
41+
with:
42+
python-version: "3.14"
43+
cache: "pip"
44+
45+
- name: Install Python dependencies
46+
shell: bash
47+
run: |
48+
echo "📦 Installing Python dependencies..."
49+
# Install dependencies for Python SDK
50+
if [ -f "pyproject.toml" ]; then
51+
pip install -e . || echo "Failed to install Python SDK"
52+
fi
53+
# Install dependencies for examples
54+
if [ -f "examples/requirements.txt" ]; then
55+
cd examples
56+
pip install -r requirements.txt || echo "Failed to install example requirements"
57+
cd ..
58+
fi
59+
echo "✅ Python dependencies installed"
60+
61+
# Initializes the CodeQL tools for scanning.
62+
- name: Initialize CodeQL
63+
uses: github/codeql-action/init@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
64+
with:
65+
languages: python
66+
build-mode: none
67+
queries: +security-extended,security-and-quality
68+
config: |
69+
name: "CodeQL Config"
70+
queries:
71+
- uses: security-extended
72+
- uses: security-and-quality
73+
query-filters:
74+
- exclude:
75+
# Helm values files use empty strings as defaults
76+
id: js/empty-password-in-configuration-file
77+
paths-ignore:
78+
- "**/*_pb2.py"
79+
- "**/*_pb2_grpc.py"
80+
81+
- name: Perform CodeQL Analysis
82+
uses: github/codeql-action/analyze@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
83+
with:
84+
category: "/language:python"

0 commit comments

Comments
 (0)