diff --git a/checkov/yaml_doc/runner.py b/checkov/yaml_doc/runner.py index 0aca8268c57..a556f01f103 100644 --- a/checkov/yaml_doc/runner.py +++ b/checkov/yaml_doc/runner.py @@ -69,7 +69,7 @@ def resolve_sub_name(definition: dict[str, Any], start_line: int, end_line: int, if not definition: return "" for key, sub_name in definition.get(tag, {}).items(): - if key in (START_LINE, END_LINE): + if key in (START_LINE, END_LINE) or not isinstance(sub_name, dict): continue if sub_name[START_LINE] <= start_line <= end_line <= sub_name[END_LINE]: return str(key) diff --git a/tests/circleci_pipelines/resources/.circleci/config.yml b/tests/circleci_pipelines/resources/.circleci/config.yml index b8e4da7ab9c..2c1f61137ab 100644 --- a/tests/circleci_pipelines/resources/.circleci/config.yml +++ b/tests/circleci_pipelines/resources/.circleci/config.yml @@ -1,5 +1,5 @@ ---- -orbs: +--- +orbs: new-orb: "whatever/orbname@goodorb" some-orb: "orbs/orbname@dev:blah" @@ -9,6 +9,9 @@ executors: - "image": "mongo:2.6.8" jobs: + test-job-single-line: say-hello-workflow/script + test-job-list-line: + - checkout test-docker-hash-img: docker: - @@ -92,9 +95,9 @@ jobs: name: "Echo the PR Reponame" version: 2.1 -workflows: - say-hello-workflow: - jobs: +workflows: + say-hello-workflow: + jobs: - test-docker-hash-img - test-docker-latest-img - test-docker-versioned-img diff --git a/tests/github/resources/github_conf/empty_collabs/repository_collaborators.json b/tests/github/resources/github_conf/empty_collabs/repository_collaborators.json new file mode 100644 index 00000000000..0637a088a01 --- /dev/null +++ b/tests/github/resources/github_conf/empty_collabs/repository_collaborators.json @@ -0,0 +1 @@ +[] \ No newline at end of file