[GHF] Validate graphql output (#83366)

If checkrun nodes are not instance of dictionary, skip them

Should prevent  https://github.com/pytorch/pytorch/pull/83215#issuecomment-1213617665 from happening in the future

Pull Request resolved: https://github.com/pytorch/pytorch/pull/83366
Approved by: https://github.com/kit1980
diff --git a/.github/scripts/trymerge.py b/.github/scripts/trymerge.py
index 2a9358b..8be44f2 100755
--- a/.github/scripts/trymerge.py
+++ b/.github/scripts/trymerge.py
@@ -508,6 +508,9 @@
             has_failing_check = False
             while checkruns is not None:
                 for checkrun_node in checkruns["nodes"]:
+                    if not isinstance(checkrun_node, dict):
+                        warn(f"Expected dictionary, but got {type(checkrun_node)}")
+                        continue
                     if checkrun_node["conclusion"] == 'FAILURE':
                         has_failing_check = True
                     conclusions[f'{get_check_run_name_prefix(workflow_run)}{checkrun_node["name"]}'] = (