This is an automated email from the ASF dual-hosted git repository.

janc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git


The following commit(s) were added to refs/heads/master by this push:
     new 912e38e24 ci: Make CodeQL fail_on_error.py more robust
912e38e24 is described below

commit 912e38e24e9a3b5576aa219c3aa064b4243af441
Author: Szymon Janc <[email protected]>
AuthorDate: Thu May 8 18:26:00 2025 +0200

    ci: Make CodeQL fail_on_error.py more robust
    
    Avoid hardcoded index which causes issues if json structure is
    modified.
---
 .github/workflows/fail_on_error.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/fail_on_error.py 
b/.github/workflows/fail_on_error.py
index 29791742b..e500e24df 100755
--- a/.github/workflows/fail_on_error.py
+++ b/.github/workflows/fail_on_error.py
@@ -11,7 +11,10 @@ def codeql_sarif_contain_error(filename):
     for run in s.get('runs', []):
         rules_metadata = run['tool']['driver']['rules']
         if not rules_metadata:
-            rules_metadata = run['tool']['extensions'][0]['rules']
+            for extension in run['tool']['extensions']:
+                if 'rules' in extension:
+                    rules_metadata = extension['rules']
+                    break
 
         for res in run.get('results', []):
             if 'ruleIndex' in res:

Reply via email to