3636 - name : Checkout central repository
3737 uses : actions/checkout@v4
3838
39+ - name : Checkout CodeQL Coding Standards scripts
40+ uses : actions/checkout@v4
41+ with :
42+ repository : github/codeql-coding-standards
43+ path : codeql-coding-standards-repo # Klonen in diesen Ordner
44+ ref : main # Oder eine spezifische Release-Version, z.B. 'v2.53.0-dev'
45+
46+ # Add coding standard packages and dependencies
47+ - name : Install Python dependencies for Coding Standards scripts
48+ run : |
49+ python3 -m pip install --upgrade pip
50+ pip3 install pyyaml jsonpath-ng jsonschema jsonpatch jsonpointer pytest
51+
3952 - name : Parse known_good.json and create repos.json
4053 id : parse-repos
4154 run : |
@@ -141,6 +154,7 @@ jobs:
141154 languages : cpp
142155 build-mode : none
143156 packs : codeql/misra-cpp-coding-standards
157+ config-file : ./.github/codeql/codeql-config.yml
144158
145159 - name : Perform CodeQL Analysis
146160 uses : github/codeql-action/analyze@v4
@@ -149,6 +163,22 @@ jobs:
149163 output : sarif-results/
150164 category : " multi-repo-scan"
151165
166+ - name : Recategorize Guidelines
167+ if : always()
168+ run : |
169+ RECATEGORIZE_SCRIPT="codeql-coding-standards-repo/scripts/guideline_recategorization/recategorize.py"
170+ CODING_STANDARDS_CONFIG="./.github/codeql/coding-standards.yml"
171+ mkdir -p sarif-results-recategorized
172+ for sarif_file in sarif-results/*.sarif; do
173+ echo "Processing $sarif_file for recategorization..."
174+ python3.9 "$RECATEGORIZE_SCRIPT" \
175+ coding_standards_config_file "$CODING_STANDARDS_CONFIG" \
176+ sarif_in "$sarif_file" \
177+ sarif_out "sarif-results-recategorized/$(basename "$sarif_file")"
178+ done
179+ rm -rf sarif-results/*
180+ mv sarif-results-recategorized/* sarif-results/
181+
152182 - name : Upload SARIF results as artifact
153183 uses : actions/upload-artifact@v4
154184 with :
0 commit comments